fixing fixing“无法在go build
Understanding the Package Directory Structure
Go expects packages to reside in directories with the same name as their package names.导入软件包时,“导入”语句指定软件包名称,而不是源文件名。因此,在您的示例中,应将foobar.go放在$ gopath/src/foobar/。
配置路径(建议):Organize Your Code:
Place main.go in a subfolder under $GOPATH/src to better organize your projects.
Use "go install": Execute "go install test" (assuming your project is now in $GOPATH/src/test/) to install $ gopath/bin中的可执行文件,允许您直接从终端运行。
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3