问题:
warning: GOPATH set to GOROOT (C:\Go) has no effect
main.go:5:2: cannot find package "userinfo" in any of:
C:\Go\src\userinfo (from $GOROOT)
($GOPATH not set. For more details see: 'go help gopath')
目录
结构
正常来说,这样是无问题的,
问题就发生在 go的环境中
需要配置一下GOPATH的环境,把GOPATH的环境 设置到当前需要运行的项目目录
注意看GOPATH 红色框的路径以及当前项目的路径!!!
然后就ok了