首页 > 其他 > 详细

简单脚本拉取Golang缺失包

时间:2019-07-11 21:24:57      阅读:353      评论:0      收藏:0      [点我收藏+]

报错格式一般如下:

../../../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

简单脚本拉取Golang缺失包

原文:https://www.cnblogs.com/ytz1996/p/11172791.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!