go version)?go version go1.13.5 linux/amd64
Yes
go env)?go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/xxx/.cache/go-build"
GOENV="/home/xxx/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/xxx/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/xxx/qqq/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build840764954=/tmp/go-build -gno-record-gcc-switches"
Tried to build my code which is working in go version 1.13.4
Expected my code to build successfully
# runtime
/usr/local/go/src/runtime/map.go:65:2: bucketCntBits redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:64:18
/usr/local/go/src/runtime/map.go:66:2: bucketCnt redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:65:23
/usr/local/go/src/runtime/map.go:77:2: maxKeySize redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:74:17
/usr/local/go/src/runtime/map.go:83:2: dataOffset redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:83:4
/usr/local/go/src/runtime/map.go:94:2: evacuatedX redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:91:19
/usr/local/go/src/runtime/map.go:95:2: evacuatedY redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:92:19
/usr/local/go/src/runtime/map.go:96:2: evacuatedEmpty redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:90:19
/usr/local/go/src/runtime/map.go:97:2: minTopHash redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:93:19
/usr/local/go/src/runtime/map.go:100:2: iterator redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:96:16
/usr/local/go/src/runtime/map.go:101:2: oldIterator redeclared in this block
previous declaration at /usr/local/go/src/runtime/hashmap.go:97:16
/usr/local/go/src/runtime/map.go:101:2: too many errors
Did you unzip a new go version over a directory containing an old version, by any chance? I believe you must clear out the previous version before installing the new version (or have unique paths per version, etc)
Yeah this happens when you unzip a new version over the old one without deleting the old folder.
Please rm -rf /usr/local/go and try to reinstall Go from a clean state. Closing here, but feel free to comment if the error persists.
Most helpful comment
Yeah this happens when you unzip a new version over the old one without deleting the old folder.
Please
rm -rf/usr/local/goand try to reinstall Go from a clean state. Closing here, but feel free to comment if the error persists.