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

就是最新的了

 


免責聲明!

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



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