From 3981025fa4a81eea3f2d5838ac7a870ea3e6f072 Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Sun, 13 Nov 2022 09:05:52 -0500 Subject: [PATCH] gofmt --- pkg/auth/session.go | 10 +++++----- pkg/storage/storage.go | 30 +++++++++++++++--------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pkg/auth/session.go b/pkg/auth/session.go index aedfc0e..1e709b1 100644 --- a/pkg/auth/session.go +++ b/pkg/auth/session.go @@ -66,11 +66,11 @@ func (ss *SessionStore) verify(tr *TokenRequest, r *http.Request) (provider.Prov } type Credential struct { - ID CredID `json:"id"` - UserID UserID `json:"user_id"` - AuthProviderType string `json:"auth_provider_type"` - AuthProviderID *string `json:"auth_provider_id"` - DataRaw *json.RawMessage `json:"data,omitempty"` + ID CredID `json:"id"` + UserID UserID `json:"user_id"` + AuthProviderType string `json:"auth_provider_type"` + AuthProviderID *string `json:"auth_provider_id"` + DataRaw *json.RawMessage `json:"data,omitempty"` user provider.ProviderUser `json:"-"` } diff --git a/pkg/storage/storage.go b/pkg/storage/storage.go index b2d992e..1e4d0c4 100644 --- a/pkg/storage/storage.go +++ b/pkg/storage/storage.go @@ -19,7 +19,7 @@ var ( ) const ( - SecretMode os.FileMode = 0600 + SecretMode os.FileMode = 0600 DefaultMode os.FileMode = 0644 ) @@ -27,10 +27,10 @@ type Data interface { } type item struct { - Version int `json:"version"` - MinorVersion *int `json:"minor_version,omitempty"` - Key string `json:"key"` - Data interface{} `json:"data"` + Version int `json:"version"` + MinorVersion *int `json:"minor_version,omitempty"` + Key string `json:"key"` + Data interface{} `json:"data"` fmode os.FileMode dirty bool @@ -44,11 +44,11 @@ type Item interface { ItemKey() string } -func (i *item) Dirty() { i.dirty = true } -func (i *item) IsDirty() bool { return i.dirty } -func (i *item) GetData() interface{} { return i.Data } +func (i *item) Dirty() { i.dirty = true } +func (i *item) IsDirty() bool { return i.dirty } +func (i *item) GetData() interface{} { return i.Data } func (i *item) SetData(d interface{}) { i.Data = d; i.Dirty() } -func (i *item) ItemKey() string { return i.Key } +func (i *item) ItemKey() string { return i.Key } func (it *item) mode() os.FileMode { if it.fmode != 0 { @@ -61,7 +61,7 @@ func (it *item) mode() os.FileMode { type fsStore struct { fs.FS storeRoot string - s map[string]*item + s map[string]*item } type Store interface { @@ -147,10 +147,10 @@ func (s *fsStore) Put(key string, version, minorVersion int, secretMode bool, da } it := &item{ - Version: version, + Version: version, MinorVersion: mv, - Key: key, - Data: data, + Key: key, + Data: data, fmode: mode, dirty: true, @@ -197,8 +197,8 @@ func OpenFileStore(configRoot string) (*fsStore, error) { stor := os.DirFS(storeRoot) return &fsStore{ - FS: stor, + FS: stor, storeRoot: storeRoot, - s: make(map[string]*item), + s: make(map[string]*item), }, nil }