go的打包依赖构建工具-dep
首先市面上大多数人都是用godep,原因是这个出来得比较早。
godep已经不再维护了,可以在github上看到以下声明:
Godep - Archived
Please use dep or another tool instead.
Godep will continue to be supported for some time but is considered to be in a state of support rather than active feature development.
dep是官方使用的,godep是第三方的。
dep的使用:
go get -u github.com/golang/dep/cmd/dep
在go工程目录下:
创建新项目:
cd $GOPATH/src 即为 cd /golang/src
dep init app
就会生成Gopkg.lock, Gopkg.toml vendor/
或者 在已有项目下
cd /golang/src/game_server
dep init
也会生成3个文件:Gopkg.lock, Gopkg.toml vendor/
假如我在Gopkg.toml里面增删改了某些库,只需要执行
dep ensure
就是最新的了