0

I have two code repository A and B in Go, A depends on B using gomod management. For example, the latest tag version of B is v1.0.1 and the same version in A's go.mod, and then some new commits are merged into B, but without upgrade tag. Can I get the latest changes just by go get -u A_GIT_PATH? I try some times, but I can't get the newest B into my local workplace, may gomod's cache causes this problem?

Looking forward for any suggest, thanks so much~

  • 1
    If you are using Go modules then you can only update to a version that is tagged in version control. Ie, you will need to tag the B repo with a new tag like 1.0.2 or checkout the code code to another location and use `replace`. – Andrew W. Phillips Feb 24 '20 at 08:19

1 Answers1

0

You will need to set up your go.mod to source from local project.

replace "github.com/userName/otherModule" v0.0.0 => "local/path/the/module"

eg: here

diyoda_
  • 5,274
  • 8
  • 57
  • 89