GolangNote

Golang笔记

Go build 错误 “stackcheck redeclared in this block previous declaration”的解决方法

Permalink

go 1.13 刚发布,这个版本改变比较多,一般 go 升级后都会习惯的跟着升级主程序。这次升级后 build 时遇到了 stack check redeclared in this block previous declaration 错误。

Go build 错误 “stackcheck redeclared in this block previous declaration”的解决方法

Bash: go runtime err
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 包

Bash: rm go
1
2
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

目前的 go 最新版

Bash: go version
1
2
$ go version
go version go1.13 linux/amd64

Related articles

vuego: 用GO编写 vue.js 前端

vuego 是一个基于WASM 对Vue.js 的封装,使用Web Assembly 编译。可以让开发者用go 来写Vue.js 前端脚本。...

Go 1.5.1 更新的功能

Go 1.5.1版本对编译器,汇编器, fmt, net/textproto, net/http, 和 runtime 包的 bug 修复。...

Write a Comment to "Go build 错误 “stackcheck redeclared in this block previous declaration”的解决方法"

Submit Comment Login
Based on Golang + fastHTTP + youdb | go1.16 Processed in 0ms