我正在使用以下Go模塊來構(gòu)建一個應(yīng)用程序:github.com/martinlindhe/unit現(xiàn)在,Go代碼非常簡單;我只是想為真正的工作設(shè)置環(huán)境: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執(zhí)行任一操作或?qū)?dǎo)致:go buildgo getpackage unit is not in GOROOT (/usr/local/Cellar/go/1.17/libexec/src/unit)正在運行,執(zhí)行時沒有錯誤。go.sum文件似乎是正確的,所有必要的依賴項都存在。go mod download該環(huán)境是最新版本的VS代碼,通過自制安裝在MacOS大蘇爾11.5.2上一定有什么明顯的東西我錯過了。我寫的其他應(yīng)用程序沒有這個問題。
- 1 回答
- 0 關(guān)注
- 102 瀏覽
添加回答
舉報
0/150
提交
取消
