main.go:5:2: package rpcdemo is not in GOROOT (/usr/local/go/src/rpcdemo)

golang 运行项目出错:

main.go:5:2: package rpcdemo is not in GOROOT (/usr/local/go/src/rpcdemo)

解决办法:

go env -w GO111MODULE="auto"

你可能感兴趣的:(golang)