2017-03-21 24 views
0

我已經在供應商/目錄中使用了godep和vendored所有依賴關係。 Go build也工作得很好。但是,我怎麼能確定我的所有依賴關係都已售賣?如何確保構建使用供應商目錄中的所有依賴關係

有什麼命令可以確定嗎?

+0

切換到一個新的,乾淨的,空的GOPATH,git克隆和構建。死簡單。 – Volker

+0

是的。這是一種方式。我只是問是否有任何事情可以避免,比如在'go build'命令中傳遞一個標誌。 –

回答

1

我的CI服務(我使用的是Travis)讓我知道。因爲如果代碼不可用,我的測試版本將會失敗。

無論如何,您應該使用CI服務,然後您可以免費獲得該優惠。

+0

我正在開發部署在heroku上的小型項目,並使用github啓用自動部署。 –

0

我使用govendor來管理依賴關係,它具有status選項。下面是一些與govendor的命令:

init  Create the "vendor" folder and the "vendor.json" file. 
list  List and filter existing dependencies and packages. 
add  Add packages from $GOPATH. 
update Update packages from $GOPATH. 
remove Remove packages from the vendor folder. 
status Lists any packages missing, out-of-date, or modified locally. 
fetch Add new or update vendor folder packages from remote repository. 
sync  Pull packages into vendor folder from remote repository with revisions 
      from vendor.json file. 
migrate Move packages from a legacy tool to the vendor folder with metadata. 

具體來說,你會做govendor status,以檢查是否有遺漏的包。

如果你決定使用govendor,你可以得到這樣做開始:

  • go get github.com/kardianos/govendor
  • govendor migrate(將從godeps遷移到govendor)

此外,您在提到評論你部署到Heroky,這裏是一些documentation from them on govendor

相關問題