tools / godep

dependency tool for go
http://godoc.org/github.com/tools/godep
BSD 3-Clause "New" or "Revised" License
5.54k stars 455 forks source link

godep save deletes every package from vendor folder and Godeps.json file #512

Closed kristijan-ujevic closed 6 years ago

kristijan-ujevic commented 8 years ago

Expected behavior

godep save should update vendor folder and Godeps.json file with new packages

Actual behavior

  1. fresh git checkout
  2. godep restore
  3. godep save
  4. everything is deleted

    Steps to reproduce behavior

see above

godep version output

godep v74 (linux/amd64/go1.6.2)

go version output

go version go1.6.2 linux/amd64

Contents of Godeps.json file

after running godep save it just contains the head section with no packages

chnrxn commented 7 years ago

This is a critical bug IMO.

kristijan-ujevic commented 7 years ago

agreed

freeformz commented 7 years ago

It's likely that there is a problem with your $GOPATH. godep will only do this if it doesn't find any packages. Also if you are using godep from brew, make sure to uninstall it as it's known to cause problems.

On Fri, Nov 11, 2016 at 1:44 AM Kristijan Ujević notifications@github.com wrote:

agreed

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tools/godep/issues/512#issuecomment-259920055, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAZ7yUSdRfB4R6vJrOF5-LrMDtk4BTks5q9DjvgaJpZM4J4yaz .

kristijan-ujevic commented 7 years ago

echo $GOPATH

output: /home/MyUsername/go

freeformz commented 7 years ago

Also pwd. Is there any difference in case? The other thing may be the pkg spec passed to save. By default it is '.'. If there are no files to analyze in the current directory then Godeps.json will be blank and everything will be deleted from vendor. What is the layout of the project?

On Tue, Nov 15, 2016 at 4:22 AM Kristijan Ujević notifications@github.com wrote:

echo $GOPATH

output: /home/MyUsername/go

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/tools/godep/issues/512#issuecomment-260627286, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAZ6Qy-2cvFULARI0o4ZoVOAOtRaYaks5q-aQQgaJpZM4J4yaz .

johanoskarsson commented 7 years ago

We're seeing the same problem. We have one codebase but multiple starting points in: project/cmd//main.go. We don't have any .go files in the project root. Unfortunately this seems to confuse godep as described in this issue.

freeformz commented 6 years ago

I am closing this issue because the repo is going to be archived.

mhemmings commented 6 years ago

I do fear this repo is being archived way too soon. Doesn't look like dep is going to be the tool used going forward as it has too many flaws, and vgo isn't ready yet. Teams still rely on this package, and bugs like this are critical.