简单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