我正在嘗試構(gòu)建我在此repo中找到的 teamcity prometheus exporter 。在自述文件中,它指示我執(zhí)行以下應(yīng)該構(gòu)建項目的命令 - docker run --rm -v "$PWD":/go/src/github.com/guidewire/teamcity_exporter -w /go/src/github.com/guidewire/teamcity_exporter -e GOOS=linux -e GOARCH=amd64 golang:1.8 go build -o bin/teamcity_exporter -v但它失敗并出現(xiàn)以下錯誤 -teamcity_exporter.go:15:2: cannot find package "github.com/guidewire/teamcity-go-bindings" in any of: /go/src/github.com/guidewire/teamcity_exporter/vendor/github.com/guidewire/teamcity-go-bindings (vendor tree) /usr/local/go/src/github.com/guidewire/teamcity-go-bindings (from $GOROOT) /go/src/github.com/guidewire/teamcity-go-bindings (from $GOPATH)teamcity_exporter.go:16:2: cannot find package "github.com/orcaman/concurrent-map" in any of: /go/src/github.com/guidewire/teamcity_exporter/vendor/github.com/orcaman/concurrent-map (vendor tree) /usr/local/go/src/github.com/orcaman/concurrent-map (from $GOROOT) /go/src/github.com/orcaman/concurrent-map (from $GOPATH)collector.go:6:2: cannot find package "github.com/prometheus/client_golang/prometheus" in any of: /go/src/github.com/guidewire/teamcity_exporter/vendor/github.com/prometheus/client_golang/prometheus (vendor tree) /usr/local/go/src/github.com/prometheus/client_golang/prometheus (from $GOROOT) /go/src/github.com/prometheus/client_golang/prometheus (from $GOPATH)teamcity_exporter.go:18:2: cannot find package "github.com/prometheus/common/log" in any of: /go/src/github.com/guidewire/teamcity_exporter/vendor/github.com/prometheus/common/log (vendor tree) /usr/local/go/src/github.com/prometheus/common/log (from $GOROOT) /go/src/github.com/prometheus/common/log (from $GOPATH)我嘗試四處尋找 go 包管理器并使用它們來預(yù)安裝包(遍歷dep和govendor但兩者似乎都不適合我的用例)。還在 github 存儲庫中打開了一個問題,但還有一些其他問題沒有得到任何回應(yīng),所以我沒有抱太大希望。我對 go 不太熟悉,所以我希望這里的人可能知道我缺少什么。謝謝!
go build 找不到包源
慕的地6264312
2023-05-08 16:28:58