2019年9月17日 星期二

[golang] golang 升級到 1.13 以後 tubs_x86.go:10:6: stackcheck redeclared in this block previous declaration at /usr/local/go/src/runtime/stubs_amd64x.go:

golang 升級到 1.13 以後 ,在 go run 時出現下列問題

go run main.go
# 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

原來是有些舊有的 package 產生衝突
徹底清除資料夾後在untar一次

sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.13.linux-amd64.tar.gz

沒有留言:

張貼留言