From 43317530d5f35278bf33321078fd91f7aed19b99 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 8 Mar 2017 20:42:45 -0800 Subject: [PATCH] Fix odd shadowing bug in XL init. (#3874) Fixes #3873 --- Makefile | 6 ++---- cmd/xl-v1.go | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f9eb341fa..9c5127ef7 100644 --- a/Makefile +++ b/Makefile @@ -71,10 +71,8 @@ verifiers: vet fmt lint cyclo spelling vet: @echo "Running $@:" - @go tool vet -all ./cmd - @go tool vet -all ./pkg - @go tool vet -shadow=true ./cmd - @go tool vet -shadow=true ./pkg + @go vet github.com/minio/minio/cmd/... + @go vet github.com/minio/minio/pkg/... fmt: @echo "Running $@:" diff --git a/cmd/xl-v1.go b/cmd/xl-v1.go index 147a0411d..f58cb9182 100644 --- a/cmd/xl-v1.go +++ b/cmd/xl-v1.go @@ -140,9 +140,9 @@ func newXLObjects(storageDisks []StorageAPI) (ObjectLayer, error) { // Check if object cache is enabled. if xl.objCacheEnabled { // Initialize object cache. - objCache, err := objcache.New(maxCacheSize, objcache.DefaultExpiry) - if err != nil { - return nil, err + objCache, oerr := objcache.New(maxCacheSize, objcache.DefaultExpiry) + if oerr != nil { + return nil, oerr } objCache.OnEviction = func(key string) { debug.FreeOSMemory()