diff options
author | Cameron Moore <moorereason@gmail.com> | 2018-09-06 11:02:32 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-09-07 08:25:51 +0200 |
commit | b8b91f550646b2620649c3504e14a441975bea9f (patch) | |
tree | 43884ec81f153aa63a25e6a51c3d187579024bda /common/maps/scratch.go | |
parent | f0effac80426325040c4bc703cd610f434d0b5a8 (diff) |
common: Fix golint errors
common/errors/errors.go:21:1: comment on exported var FeatureNotAvailableErr should be of the form "FeatureNotAvailableErr ..."
common/errors/errors.go:23:5: error var FeatureNotAvailableErr should have name of the form ErrFoo
common/maps/scratch.go:76:1: comment on exported method Scratch.Delete should be of the form "Delete ..."
common/maps/scratch.go:133:1: exported function NewScratch should have comment or be unexported
common/types/types.go:44:1: exported function NewKeyValuesStrings should have comment or be unexported
Diffstat (limited to 'common/maps/scratch.go')
-rw-r--r-- | common/maps/scratch.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/maps/scratch.go b/common/maps/scratch.go index d00971435..4b062d139 100644 --- a/common/maps/scratch.go +++ b/common/maps/scratch.go @@ -73,7 +73,7 @@ func (c *Scratch) Set(key string, value interface{}) string { return "" } -// Reset deletes the given key +// Delete deletes the given key. func (c *Scratch) Delete(key string) string { c.mu.Lock() delete(c.values, key) @@ -81,7 +81,7 @@ func (c *Scratch) Delete(key string) string { return "" } -// Get returns a value previously set by Add or Set +// Get returns a value previously set by Add or Set. func (c *Scratch) Get(key string) interface{} { c.mu.RLock() val := c.values[key] @@ -104,7 +104,7 @@ func (c *Scratch) SetInMap(key string, mapKey string, value interface{}) string return "" } -// GetSortedMapValues returns a sorted map previously filled with SetInMap +// GetSortedMapValues returns a sorted map previously filled with SetInMap. func (c *Scratch) GetSortedMapValues(key string) interface{} { c.mu.RLock() @@ -130,6 +130,7 @@ func (c *Scratch) GetSortedMapValues(key string) interface{} { return sortedArray } +// NewScratch returns a new instance Scratch. func NewScratch() *Scratch { return &Scratch{values: make(map[string]interface{})} } |