godeps

Godep save deletes all deps in vendor and godep update


Im pretty new to Go but not to software. Im working on a new team with lots of projects and dependencies so we must use godep.

All the code is structure in the standard Go way, with files in $GOPATH/.../github.com/... etc (including our work which is in github)

I made changes to project A (github.com/ourTeam/A) and I want to run project B (github.com/ourTeam/B) which references A to test my code. so I commit my work from A in my own branch in A, (and even pushed the branch).

-> All I want is to update B with my new version of A.

From B, I tried:

What am I missing ?

Note: Im using godep v65 (darwin/amd64/go1.6.2) and godep save -v said

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

Solution

  • The error message when you tried to update tells me that the dependency on A had not been godep-saved before in B. That would mean you need to save it, instead of updating.

    Today, I was having the same problem as you using godep save. All dependencies were being removed. However, this got me through it:

    $ 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.
    

    Once godep save returned without errors, I checked and it had done as expected. It only added the new dependency I had imported in the code.