From: Ward Vandewege Date: Thu, 1 Oct 2020 23:44:14 +0000 (-0400) Subject: Fix more golint warnings. X-Git-Tag: 2.1.0~24 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/fa78e264ef585f02348f4f5c0a7183746a708a8f?ds=sidebyside Fix more golint warnings. No issue # Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- diff --git a/lib/dispatchcloud/test/queue.go b/lib/dispatchcloud/test/queue.go index 8a8f686e16..3598ec6da0 100644 --- a/lib/dispatchcloud/test/queue.go +++ b/lib/dispatchcloud/test/queue.go @@ -172,12 +172,11 @@ func (q *Queue) Notify(upd arvados.Container) bool { if allowContainerUpdate[ctr.State][upd.State] { q.Containers[i] = upd return true - } else { - if q.Logger != nil { - q.Logger.WithField("ContainerUUID", ctr.UUID).Infof("test.Queue rejected update from %s to %s", ctr.State, upd.State) - } - return false } + if q.Logger != nil { + q.Logger.WithField("ContainerUUID", ctr.UUID).Infof("test.Queue rejected update from %s to %s", ctr.State, upd.State) + } + return false } } q.Containers = append(q.Containers, upd) diff --git a/sdk/go/keepclient/keepclient.go b/sdk/go/keepclient/keepclient.go index 13f8f95771..8eff377ce6 100644 --- a/sdk/go/keepclient/keepclient.go +++ b/sdk/go/keepclient/keepclient.go @@ -492,9 +492,8 @@ func (kc *KeepClient) getSortedRoots(locator string) []string { func (kc *KeepClient) cache() *BlockCache { if kc.BlockCache != nil { return kc.BlockCache - } else { - return DefaultBlockCache } + return DefaultBlockCache } func (kc *KeepClient) ClearBlockCache() { @@ -575,9 +574,8 @@ var reqIDGen = httpserver.IDGenerator{Prefix: "req-"} func (kc *KeepClient) getRequestID() string { if kc.RequestID != "" { return kc.RequestID - } else { - return reqIDGen.Next() } + return reqIDGen.Next() } type Locator struct { diff --git a/services/keep-web/cache.go b/services/keep-web/cache.go index 2ff2136ed7..5400f694fd 100644 --- a/services/keep-web/cache.go +++ b/services/keep-web/cache.go @@ -224,13 +224,12 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo }) } return collection, err - } else { - // PDH changed, but now we know we have - // permission -- and maybe we already have the - // new PDH in the cache. - if coll := c.lookupCollection(arv.ApiToken + "\000" + current.PortableDataHash); coll != nil { - return coll, nil - } + } + // PDH changed, but now we know we have + // permission -- and maybe we already have the + // new PDH in the cache. + if coll := c.lookupCollection(arv.ApiToken + "\000" + current.PortableDataHash); coll != nil { + return coll, nil } } diff --git a/services/keepstore/volume.go b/services/keepstore/volume.go index 5a277b6007..4d8a0aec7a 100644 --- a/services/keepstore/volume.go +++ b/services/keepstore/volume.go @@ -353,9 +353,8 @@ func (vm *RRVolumeManager) Mounts() []*VolumeMount { func (vm *RRVolumeManager) Lookup(uuid string, needWrite bool) *VolumeMount { if mnt, ok := vm.mountMap[uuid]; ok && (!needWrite || !mnt.ReadOnly) { return mnt - } else { - return nil } + return nil } // AllReadable returns an array of all readable volumes