我正在使用以下Go模塊來構建一個應用程序:github.com/martinlindhe/unit現在,Go代碼非常簡單;我只是想為真正的工作設置環境:import( "fmt" "unit" )foo := unit.FromFahrenheit(100)fmt.Println("100 fahrenheit in celsius = ", foo.Celsius())在 go.mod 中:go 1.17require github.com/martinlindhe/unit v0.0.0-20210313160520-19b60e03648d執行任一操作或將導致:go buildgo getpackage unit is not in GOROOT (/usr/local/Cellar/go/1.17/libexec/src/unit)正在運行,執行時沒有錯誤。go.sum文件似乎是正確的,所有必要的依賴項都存在。go mod download該環境是最新版本的VS代碼,通過自制安裝在MacOS大蘇爾11.5.2上一定有什么明顯的東西我錯過了。我寫的其他應用程序沒有這個問題。
- 1 回答
- 0 關注
- 95 瀏覽
添加回答
舉報
0/150
提交
取消