亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

go build 找不到包源

go build 找不到包源

Go
慕的地6264312 2023-05-08 16:28:58
我正在嘗試構建我在此repo中找到的 teamcity prometheus exporter 。在自述文件中,它指示我執行以下應該構建項目的命令 - 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但它失敗并出現以下錯誤 -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 包管理器并使用它們來預安裝包(遍歷dep和govendor但兩者似乎都不適合我的用例)。還在 github 存儲庫中打開了一個問題,但還有一些其他問題沒有得到任何回應,所以我沒有抱太大希望。我對 go 不太熟悉,所以我希望這里的人可能知道我缺少什么。謝謝!
查看完整描述

1 回答

?
12345678_0001

TA貢獻1802條經驗 獲得超5個贊

我建議go build改為go get. 這應該獲取所有依賴項,還將構建二進制文件并將其放入$GOPATH/bingo build期望一切都已經到位。



查看完整回答
反對 回復 2023-05-08
  • 1 回答
  • 0 關注
  • 218 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號