0

I need to update stripe-go library version. Project has 19.** New version 52.** There is a godeps dependency manager

When I try to run

godep save github.com/stripe/stripe-go

I get

godep: cannot save github.com/stripe/stripe-go/form at revision f8b095462d541c43d981d28de52b7464b25f3ee1: already have github.com/stripe/stripe-go at revision 87c04229ff0262e4e7dfc8af7dc97a471e955ba2.

Run `godep update github.com/stripe/stripe-go' first.

And when I run

godep update github.com/stripe/stripe-go

I get

godep: no packages can be updated

What do I do wrong?

b3lowster
  • 415
  • 1
  • 6
  • 18

1 Answers1

1

I remember this issue, quoting from https://github.com/tools/godep/issues/164#issuecomment-101345584

This seems to be caused by this line here: https://github.com/tools/godep/blob/master/update.go#L205

If packages A and B are under the same root, and I try to only update B, the root will be marked for skipping update because A isn't being updated. I'm not sure what the motivation for this feature is, it seems that developers should be able to selectively update sub packages as they desire.

For what it's worth, I fixed my problem by globbing from the root in my godep update command (e.g. godep update github.com/foo/bar/... instead of github.com/foo/bar/pkg/B. A helpful error message would have gone a long way

While you're here, go 1.11 and above has inbuilt module support. Maybe look into shifting into that? https://github.com/golang/go/wiki/Modules

Karthik Nayak
  • 731
  • 3
  • 14
  • I cannot change go version. What if remove old dependencies packages form videos.json manually? and try run godeps save ? – b3lowster Jan 26 '19 at 18:25
  • could you add the json, so I can help you better? @b3lowster – Karthik Nayak Jan 26 '19 at 18:44
  • Would be enough if I share JSON file but only with Stripe dependencies? – b3lowster Jan 26 '19 at 18:54
  • @b3lowster Yeah that should be sufficient! `cat something.json | grep -i stripe`. – Karthik Nayak Jan 26 '19 at 18:58
  • cat Godeps/Godeps.json | grep -i stripe "ImportPath": "github.com/stripe/stripe-go", "ImportPath": "github.com/stripe/stripe-go/card", "ImportPath": "github.com/stripe/stripe-go/charge", "ImportPath": "github.com/stripe/stripe-go/customer", "ImportPath": "github.com/stripe/stripe-go/orderitem", "ImportPath": "github.com/stripe/stripe-go/token", – b3lowster Jan 26 '19 at 19:03
  • if i try to run : godep update github.com/stripe/.. I get: godep: not in manifest: github.com godep: no packages can be updated – b3lowster Jan 26 '19 at 20:06
  • 1
    It work for this command :) godep update github.com/stripe/... Thanks a lot – b3lowster Jan 26 '19 at 20:09
  • @b3lowster that's awesome! do accept my answer as the solution. – Karthik Nayak Jan 26 '19 at 20:32
  • What if I need to add one more submodel for instance github.com/stripe/stripe-go/payout what should I do? Project didn't have this module before – b3lowster Jan 26 '19 at 22:08
  • @b3lowster `dep ensure ` should do it. Check here https://golang.github.io/dep/docs/daily-dep.html#using-dep-ensure. Basically when updating you'll face problems again, so the same solution would apply. – Karthik Nayak Jan 26 '19 at 22:12