2016-05-15 16 views
0

對於Go而言,它非常新,但不適用於軟件。我正在開發一個有很多項目和依賴的新團隊,所以我們必須使用godepGodep保存刪除供應商和godep更新中的所有代碼

所有的代碼是結構標準去路,與文件$GOPATH/.../github.com/...等(包括我們的工作是在GitHub上)

我所做的更改項目A(github.com/ourTeam/A),我想運行項目B( github.com/ourTeam/B)其中引用A來測試我的代碼。 所以我在A中的自己的分支中從A提交我的工作(甚至推動分支)。

- >我要的是我的A.

從B的新版本更新B,我想:

  • godep update github.com/A/subpackage。它說'godep:沒有包可以更新'
  • godep save。它刪除了供應商文件夾中的所有內容,將Godeps.json文件留空任何依賴關係
  • 用我的提交手動更新Godeps.json,然後運行godep更新。 沒有消息,但它沒有更新任何東西。在此更改之後的Godep保存在供應商文件夾和Godep.json中刪除了所有內容

我在想什麼?

注:即時通訊使用godep V65(達爾文/ AMD64/go1.6.2)和godep save -v

godep: Finding dependencies for [.] 
godep: Found package: github.com/ourTeam/B 
godep: Deps: 
(nothing so the diff with old file removes everything) 

回答

0

,當您嘗試更新的錯誤消息,告訴我,A上的依賴一直沒godep保存的之前在B.這意味着你需要保存它,而不是更新。

今天,我遇到了與您使用godep save相同的問題。所有依賴關係都被刪除。然而,這讓我通過它:

$ go get -u github.com/tools/godep # Make sure you have the latest godep (currently v71) 
$ godep save ./... # Literally, "./..." is the argument 

# The above command may fail with "Package not found ..." 
# Install any package not found with "go get some/package/path" 
$ go get some/package/path # if necessary 
# Try "godep save ./..." again; repeat "go get" for any "not found" errors. 

一旦godep save沒有錯誤返回,我檢查,並做了預期。它只添加了我在代碼中導入的新依賴項。

+0

謝謝,它確實是godep中的一個錯誤,獲取最新版本修復它 – Thomas

相關問題