簡單shell腳本拉取Golang缺失包


報錯格式一般如下:

../../../internal/github.com/hyperledger/fabric/protoutil/signeddata.go:16:2: cannot find package "github.com/gogo/protobuf/proto" in any of:
/usr/local/go/src/github.com/gogo/protobuf/proto (from $GOROOT)
/opt/gopath/src/github.com/gogo/protobuf/proto (from $GOPATH)
/opt/gopath/src/google.golang.org/grpc/status/status.go:37:2: cannot find package "google.golang.org/genproto/googleapis/rpc/status" in any of:
/usr/local/go/src/google.golang.org/genproto/googleapis/rpc/status (from $GOROOT)
/opt/gopath/src/google.golang.org/genproto/googleapis/rpc/status (from $GOPATH)

簡單shell腳本拉取:

grep -i "cannot find package" [錯誤信息文件名] | awk '{print $5}' | sed 's/\"/go get /' | sed 's/\"//' | sh


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM