go 1.13 刚发布,这个版本改变比较多,一般 go 升级后都会习惯的跟着升级主程序。这次升级后 build 时遇到了 stack check redeclared in this block previous declaration
错误。
1
2
3
4
5
6
7
# runtime
/usr/local/go/src/runtime/stubs_x86.go:10:6: stackcheck redeclared in this block
previous declaration at /usr/local/go/src/runtime/stubs_amd64x.go:10:6
/usr/local/go/src/runtime/unaligned1.go:11:6: readUnaligned32 redeclared in this block
previous declaration at /usr/local/go/src/runtime/alg.go:321:40
/usr/local/go/src/runtime/unaligned1.go:15:6: readUnaligned64 redeclared in this block
previous declaration at /usr/local/go/src/runtime/alg.go:329:40
原因是升级时直接覆盖,导致有些丢弃的库报错,解决方法是先删掉旧的 go pkgs
,再解压 go SDK 包
1
2
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
目前的 go 最新版
1
2
$ go version
go version go1.13 linux/amd64
本文网址: https://golangnote.com/topic/263.html 转摘请注明来源