go 问题记录
/usr/lib/go-1.10/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-008006128/000026.o: In function_cgo_05dc84caff82_Cfunc_sysconf': /tmp/go-build/cgo-gcc-prolog:32: multiple definition of
_cgo_05dc84caff82_Cfunc_sysconf’
/tmp/go-link-008006128/000024.o:/tmp/go-build/cgo-gcc-prolog:32: first defined here
collect2: error: ld returned 1 exit status
解决办法:
linux: export CGO_ENABLED=0
windows : cmd: set CGO_ENABLED=0 powershell:$env:CGO_ENABLED=0
https://github.com/golang/go/issues/15038
panic: /debug/requests is already registered. You may have two independent copies of golang.org/x/net/trace in your binary, trying to maintain separate state. This may involve a vendored copy of golang.org/x/net/trace.
解决办法:olang.org/x/net/trace这个重复了,删除所有的引用的或者系统的olang.org/x/net/的trace 只保留一个即可。注意要查看项目引用的项目是否也有
有疑问加站长微信联系(非本文作者)