尝试在我的 src 目录下运行
这是怎么回事,我该如何解决?通过谷歌搜索这个错误,发现与先前安装的 go 版本有关,但我认为 autoremove 命令会清理它和任何依赖项(因为在从源码安装之前,我确保无法找到任何 golang)。
有什么线索吗?
go build
时,出现了以下错误:
在我刚开始学习 Go 时,我在 Ubuntu 笔记本电脑上运行了imports runtime: C source files not allowed when not using cgo: atomic_amd64x.c defs.c float.c heapdump.c lfstack.c malloc.c mcache.c mcentral.c mem_linux.c mfixalloc.c mgc0.c mheap.c msize.c os_linux.c panic.c parfor.c proc.c runtime.c signal.c signal_amd64x.c signal_unix.c stack.c string.c sys_x86.c vdso_linux_amd64.c
sudo apt-get install golang
命令(14.04 LTS,64位),安装了版本 1.2。那时可以正常运行、构建和安装应用程序。然后我运行了 autoremove 命令,将其卸载,然后从 golang 网站安装了 1.4 版本。这是怎么回事,我该如何解决?通过谷歌搜索这个错误,发现与先前安装的 go 版本有关,但我认为 autoremove 命令会清理它和任何依赖项(因为在从源码安装之前,我确保无法找到任何 golang)。
有什么线索吗?