goclean-i-r尝试删除/usr/local/go/pkg/linux_amd64/runtime.a

goclean-i-r尝试删除/usr/local/go/pkg/linux_amd64/runtime.a,go,Go,这有点奇怪。当我尝试清除时-i-r尝试删除runtime.a的权限。 这正常吗 go clean -i -x cd /home/gotestprojects/src/simplehelloworld rm -f simplehelloworld.test simplehelloworld.test.exe rm -f /home/gotestprojects/pkg/linux_amd64/simplehelloworld.a go clean -r -x cd /home/gotestpro

这有点奇怪。当我尝试清除时-i-r尝试删除runtime.a的权限。 这正常吗

go clean -i -x
cd /home/gotestprojects/src/simplehelloworld
rm -f simplehelloworld.test simplehelloworld.test.exe
rm -f /home/gotestprojects/pkg/linux_amd64/simplehelloworld.a

go clean -r -x
cd /home/gotestprojects/src/simplehelloworld
rm -f simplehelloworld.test simplehelloworld.test.exe
cd /usr/local/go/src/pkg/runtime
rm -f runtime.test runtime.test.exe defs1_linux defs1_linux.exe defs2_linux defs2_linux.exe defs_arm_linux defs_arm_linux.exe defs_darwin defs_darwin.exe defs_dragonfly defs_dragonfly.exe defs_freebsd defs_freebsd.exe defs_linux defs_linux.exe defs_netbsd defs_netbsd.exe defs_netbsd_386 defs_netbsd_386.exe defs_netbsd_amd64 defs_netbsd_amd64.exe defs_netbsd_arm defs_netbsd_arm.exe defs_openbsd defs_openbsd.exe defs_windows defs_windows.exe malloc1 malloc1.exe mallocrand mallocrand.exe mallocrep mallocrep.exe mallocrep1 mallocrep1.exe race race.exe syscall_windows_test syscall_windows_test.exe vlop_arm_test vlop_arm_test.exe
cd /usr/local/go/src/pkg/unsafe
rm -f unsafe.test unsafe.test.exe
现在是错误:

go clean -i -r -x
cd /home/gotestprojects/src/simplehelloworld
rm -f simplehelloworld.test simplehelloworld.test.exe
rm -f /home/gotestprojects/pkg/linux_amd64/simplehelloworld.a
cd /usr/local/go/src/pkg/runtime
rm -f runtime.test runtime.test.exe defs1_linux defs1_linux.exe defs2_linux defs2_linux.exe defs_arm_linux defs_arm_linux.exe defs_darwin defs_darwin.exe defs_dragonfly defs_dragonfly.exe defs_freebsd defs_freebsd.exe defs_linux defs_linux.exe defs_netbsd defs_netbsd.exe defs_netbsd_386 defs_netbsd_386.exe defs_netbsd_amd64 defs_netbsd_amd64.exe defs_netbsd_arm defs_netbsd_arm.exe defs_openbsd defs_openbsd.exe defs_windows defs_windows.exe malloc1 malloc1.exe mallocrand mallocrand.exe mallocrep mallocrep.exe mallocrep1 mallocrep1.exe race race.exe syscall_windows_test syscall_windows_test.exe vlop_arm_test vlop_arm_test.exe
rm -f /usr/local/go/pkg/linux_amd64/runtime.a
go clean: remove /usr/local/go/pkg/linux_amd64/runtime.a: permission denied
cd /usr/local/go/src/pkg/unsafe
rm -f unsafe.test unsafe.test.exe

也许有什么我不明白的?

奇怪。这让我想起了。你能粘贴go env的输出吗?给你:GOARCH=amd64 GOBIN=GOCHAR=6 GOEXE=GOHOSTARCH=amd64 GOHOSTOS=linux GOOS=linux GOOS=linux GOPATH=/home/gotestprojects/GORACE=GOROOT=/usr/local/go GOTOOLDIR=/usr/local/go/pkg/tool/linux\u amd64 TERM=dumb CC=gcc gogcc标志=-g-O2-fPIC-m64-pthread CXX=g++=1@VonC:go env始终显示有效的GOROOT,即使它没有设置并且通常是/usr/local/go。@JimB事实上,通过重新阅读上面提到的链接,我终于意识到了这一点!