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