mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
build/vet: Fix all the shadowing reports with go1.6
Golang 1.6 is default version for the build now. Additionally set 'GODEBUG=cgocheck=0' for now, until we fix the erasure coding package. Readmore here https://tip.golang.org/doc/go1.6#cgo
This commit is contained in:
@@ -85,8 +85,8 @@ func FileCreateWithPrefix(filePath string, prefix string) (*File, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := os.Chmod(f.Name(), 0600); err != nil {
|
||||
if err := os.Remove(f.Name()); err != nil {
|
||||
if err = os.Chmod(f.Name(), 0600); err != nil {
|
||||
if err = os.Remove(f.Name()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, err
|
||||
|
||||
@@ -7,15 +7,15 @@ This installation document assumes Ubuntu 14.04+ on x86-64 platform.
|
||||
$ sudo apt-get install git build-essential yasm
|
||||
```
|
||||
|
||||
##### Install Go 1.5.1+
|
||||
##### Install Go 1.6+
|
||||
|
||||
Download Go 1.5.1+ from [https://golang.org/dl/](https://golang.org/dl/).
|
||||
Download Go 1.6+ from [https://golang.org/dl/](https://golang.org/dl/).
|
||||
|
||||
```sh
|
||||
$ wget https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz
|
||||
$ wget https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
|
||||
$ mkdir -p ${HOME}/bin/
|
||||
$ mkdir -p ${HOME}/go/
|
||||
$ tar -C ${HOME}/bin/ -xzf go1.5.1.linux-amd64.tar.gz
|
||||
$ tar -C ${HOME}/bin/ -xzf go1.6.linux-amd64.tar.gz
|
||||
```
|
||||
##### Setup GOROOT and GOPATH
|
||||
|
||||
@@ -25,7 +25,7 @@ and GOPATH specifies the location of your project workspace.
|
||||
```sh
|
||||
$ export GOROOT=${HOME}/bin/go
|
||||
$ export GOPATH=${HOME}/go
|
||||
$ export PATH=$PATH:${HOME}/bin/go/bin:${GOPATH}/bin
|
||||
$ export PATH=${HOME}/bin/go/bin:${GOPATH}/bin:$PATH
|
||||
```
|
||||
|
||||
## OS X (Yosemite) 10.10
|
||||
@@ -42,7 +42,7 @@ $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/maste
|
||||
$ brew install git python yasm
|
||||
```
|
||||
|
||||
##### Install Go 1.5.1+
|
||||
##### Install Go 1.6+
|
||||
|
||||
Install golang binaries using `brew`
|
||||
|
||||
@@ -60,5 +60,5 @@ and GOPATH specifies the location of your project workspace.
|
||||
$ export GOPATH=${HOME}/go
|
||||
$ export GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6)
|
||||
$ export GOROOT=$(brew --prefix)/Cellar/go/${GOVERSION}/libexec
|
||||
$ export PATH=$PATH:${GOPATH}/bin
|
||||
$ export PATH=${GOPATH}/bin:$PATH
|
||||
```
|
||||
|
||||
@@ -72,7 +72,7 @@ func New(rootPath string, minFreeDisk int64) (Filesystem, *probe.Error) {
|
||||
Version: "1",
|
||||
ActiveSession: make(map[string]*MultipartSession),
|
||||
}
|
||||
if err := saveMultipartsSession(*multiparts); err != nil {
|
||||
if err = saveMultipartsSession(*multiparts); err != nil {
|
||||
return Filesystem{}, err.Trace()
|
||||
}
|
||||
} else {
|
||||
@@ -88,7 +88,7 @@ func New(rootPath string, minFreeDisk int64) (Filesystem, *probe.Error) {
|
||||
Version: "1",
|
||||
Metadata: make(map[string]*BucketMetadata),
|
||||
}
|
||||
if err := saveBucketsMetadata(*buckets); err != nil {
|
||||
if err = saveBucketsMetadata(*buckets); err != nil {
|
||||
return Filesystem{}, err.Trace()
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -126,7 +126,7 @@ func walk(path string, info os.FileInfo, walkFn FTWFunc) error {
|
||||
for _, fileInfo := range fis {
|
||||
filename := filepath.Join(path, fileInfo.Name())
|
||||
if err != nil {
|
||||
if err := walkFn(filename, fileInfo, err); err != nil && err != ErrSkipDir && err != ErrSkipFile {
|
||||
if err = walkFn(filename, fileInfo, err); err != nil && err != ErrSkipDir && err != ErrSkipFile {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
|
||||
2
pkg/xl/cache/data/data.go
vendored
2
pkg/xl/cache/data/data.go
vendored
@@ -135,7 +135,7 @@ func (r *Cache) Append(key interface{}, value []byte) bool {
|
||||
}
|
||||
ele, hit := r.reverseItems[key]
|
||||
if !hit {
|
||||
ele := r.items.PushFront(&element{key, value})
|
||||
ele = r.items.PushFront(&element{key, value})
|
||||
r.currentSize += valueLen
|
||||
r.reverseItems[key] = ele
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user