diff --git a/tools/cache/fifo.go b/tools/cache/fifo.go index edb2c8ed..f82bf22d 100644 --- a/tools/cache/fifo.go +++ b/tools/cache/fifo.go @@ -263,10 +263,7 @@ func (f *FIFO) GetByKey(key string) (item interface{}, exists bool, err error) { func (f *FIFO) IsClosed() bool { f.lock.Lock() defer f.lock.Unlock() - if f.closed { - return true - } - return false + return f.closed } // Pop waits until an item is ready and processes it. If multiple items are diff --git a/tools/cache/heap.go b/tools/cache/heap.go index e503a45a..819325e9 100644 --- a/tools/cache/heap.go +++ b/tools/cache/heap.go @@ -304,10 +304,7 @@ func (h *Heap) GetByKey(key string) (interface{}, bool, error) { func (h *Heap) IsClosed() bool { h.lock.RLock() defer h.lock.RUnlock() - if h.closed { - return true - } - return false + return h.closed } // NewHeap returns a Heap which can be used to queue up items to process. diff --git a/tools/clientcmd/config.go b/tools/clientcmd/config.go index 12c8b84f..31f89631 100644 --- a/tools/clientcmd/config.go +++ b/tools/clientcmd/config.go @@ -135,11 +135,7 @@ func (o *PathOptions) GetDefaultFilename() string { } func (o *PathOptions) IsExplicitFile() bool { - if len(o.LoadingRules.ExplicitPath) > 0 { - return true - } - - return false + return len(o.LoadingRules.ExplicitPath) > 0 } func (o *PathOptions) GetExplicitFile() string { diff --git a/tools/record/util/util.go b/tools/record/util/util.go index d1818a8d..afcc6a6a 100644 --- a/tools/record/util/util.go +++ b/tools/record/util/util.go @@ -36,9 +36,5 @@ func ValidateEventType(eventtype string) bool { func IsKeyNotFoundError(err error) bool { statusErr, _ := err.(*errors.StatusError) - if statusErr != nil && statusErr.Status().Code == http.StatusNotFound { - return true - } - - return false + return statusErr != nil && statusErr.Status().Code == http.StatusNotFound }