文章首发于:clawhub.club
以前都是通过govendor来做包管理,这个新项目打算用官方的go module实现包管理,用起来很简单,但是。。。坑也真大。
感谢中国的互联网环境让我们不被外界的不良声音所打扰,但是也对开发者有一些不便利的影响,比如下载包的时候被墙。
通过查阅资料,最后一些golang.org或者google.golang.org下的包可以通过github引入,而cloud.google.com/go就没有成功,最后clone了github上的项目,引入的本地包。
最后go.mod献上:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| module travel-accounting
go 1.12
replace ( golang.org/x/crypto => github.com/golang/crypto v0.0.0-20190701094942-4def268fd1a4 golang.org/x/exp => github.com/golang/exp v0.0.0-20190627132806-fd42eb6b336f golang.org/x/image => github.com/golang/image v0.0.0-20190622003408-7e034cad6442 golang.org/x/lint => github.com/golang/lint v0.0.0-20190409202823-959b441ac422 golang.org/x/mobile => github.com/golang/mobile v0.0.0-20190607214518-6fa95d984e88 golang.org/x/net => github.com/golang/net v0.0.0-20190628185345-da137c7871d7 golang.org/x/oauth2 => github.com/golang/oauth2 v0.0.0-20190604053449-0f29369cfe45 golang.org/x/sync => github.com/golang/sync v0.0.0-20190423024810-112230192c58 golang.org/x/sys => github.com/golang/sys v0.0.0-20190626221950-04f50cda93cb golang.org/x/text => github.com/golang/text v0.3.2 golang.org/x/time => github.com/golang/time v0.0.0-20190308202827-9d24e82272b4 golang.org/x/tools => github.com/golang/tools v0.0.0-20190701194522-38ae2c8f6412 google.golang.org/api => github.com/googleapis/google-api-go-client v0.7.0 google.golang.org/appengine => github.com/golang/appengine v1.6.1 google.golang.org/genproto => github.com/google/go-genproto v0.0.0-20190701230453-710ae3a149df google.golang.org/grpc => github.com/grpc/grpc-go v1.22.0
)
require ( github.com/Unknwon/com v0.0.0-20190321035513-0fed4efef755 github.com/astaxie/beego v1.11.1 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/gin-gonic/gin v1.4.0 github.com/go-ini/ini v1.42.0 github.com/go-redis/redis v6.14.2+incompatible github.com/go-stack/stack v1.8.0 github.com/golang/snappy v0.0.1 github.com/jinzhu/gorm v1.9.10 github.com/sony/sonyflake v1.0.0 github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c github.com/xdg/stringprep v1.0.0 go.mongodb.org/mongo-driver v1.0.3 go.uber.org/atomic v1.4.0 go.uber.org/multierr v1.1.0 go.uber.org/zap v1.10.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0 )
replace cloud.google.com/go => D:\code\go\src\cloud.google.com\go
|