簡體   English   中英

去構建找不到包源

[英]go build can't find package sources

我試圖建立TeamCity的普羅米修斯出口我在這個發現的回購
在自述文件中,它指示我執行以下應構建項目的命令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)
teamcity_exporter.go:19:2: cannot find package "github.com/prometheus/common/version" in any of:
    /go/src/github.com/guidewire/teamcity_exporter/vendor/github.com/prometheus/common/version (vendor tree)
    /usr/local/go/src/github.com/prometheus/common/version (from $GOROOT)
    /go/src/github.com/prometheus/common/version (from $GOPATH)
config.go:8:2: cannot find package "gopkg.in/yaml.v2" in any of:
    /go/src/github.com/guidewire/teamcity_exporter/vendor/gopkg.in/yaml.v2 (vendor tree)
    /usr/local/go/src/gopkg.in/yaml.v2 (from $GOROOT)
    /go/src/gopkg.in/yaml.v2 (from $GOPATH)

我嘗試到處尋找go軟件包管理器,並使用它們來預安裝軟件包(經過了depgovendor,但兩者似乎都不適合我的用例)。

還在github存儲庫中打開了一個問題 ,但是還有其他一些問題沒有得到任何回應,所以我沒有寄予希望。

我對go不太熟悉,所以我希望這里的某人可能對我所缺少的有所了解。
謝謝!

我建議將go build更改為go get 那應該獲取所有依賴關系,還將構建二進制文件並將其放入$GOPATH/bin go build期望一切都已經就緒。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM