Skip to content

Commit

Permalink
Merge pull request kubernetes#73990 from xichengliudui/fixlinterror
Browse files Browse the repository at this point in the history
Fix golint failures pkg/kubelet/util/cache
  • Loading branch information
k8s-ci-robot authored Feb 15, 2019
2 parents 60943a7 + 4c42d54 commit bf20886
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion hack/.golint_failures
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ pkg/kubelet/status/testing
pkg/kubelet/sysctl
pkg/kubelet/types
pkg/kubelet/util
pkg/kubelet/util/cache
pkg/kubelet/util/pluginwatcher
pkg/kubelet/util/queue
pkg/kubelet/util/sliceutils
Expand Down
1 change: 1 addition & 0 deletions pkg/kubelet/util/cache/object_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (c *ObjectCache) Get(key string) (interface{}, error) {
return value.(objectEntry).obj, nil
}

// Add adds objectEntry by using a unique string as the key.
func (c *ObjectCache) Add(key string, obj interface{}) error {
err := c.cache.Add(objectEntry{key: key, obj: obj})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/util/cache/object_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestAddAndGet(t *testing.T) {
val: "bar",
}
objectCache := NewFakeObjectCache(func() (interface{}, error) {
return nil, fmt.Errorf("Unexpected Error: updater should never be called in this test!")
return nil, fmt.Errorf("Unexpected Error: updater should never be called in this test")
}, 1*time.Hour, clock.NewFakeClock(time.Now()))

err := objectCache.Add(testObj.key, testObj.val)
Expand Down

0 comments on commit bf20886

Please sign in to comment.