go build自建包报错package XXX is not in std

在构建包名的时候遇到了如下错误

C:\Users\xxx\Desktop\code\golx\src>go build example
package example is not in std (D:\Go\src\example)

解决方法

 修改 GO111MODULE 

go env -w GO111MODULE=off

你可能感兴趣的:(go,golang,开发语言,后端)