I have been working on converting our private libraries to Go Modules and I got through the initial hurdles of publishing and using a new major version of a library for example, tssgit.reyrey.com/teschste/go-httpmailer/v3
.
However, I now need to publish an update to that library from v3.0.0 to v3.1.0 and I am having issues. My understanding from what I found online is that I leave the declaration in go.mod the same module tssgit.reyrey.com/teschste/go-httpmailer/v3
and simply publish the new version. I can see the new release in our repository:
[I tried adding an image to show it but it would not add for some reason]
When I attempt to use that new version in an application, I first tried:
go get tssgit.reyrey.com/teschste/go-httpmailer/v3
but that failed with:
go: module tssgit.reyrey.com/teschste/go-httpmailer@upgrade found (v2.1.0+incompatible), but does not contain package tssgit.reyrey.com/teschste/go-httpmailer/v3
Then I tried:
go get tssgit.reyrey.com/teschste/go-httpmailer/v3@v3.1.0
but that failed with:
go: tssgit.reyrey.com/teschste/go-httpmailer/v3@v3.1.0: invalid version: go.mod has non-.../v3 module path "tssgit.reyrey.com/teschste/go-httpmailer/v3.1" (and .../v3/go.mod does not exist) at revision v3.1.0
There is a lot of information online about setting up a major version but I have not found anything so far that addresses my specific issue. I am sure I am missing something simple but at this point, I have no idea what it is. Any help would be appreciated!
After a lot more Googling, I asked for some help from someone else internally, to ensure I was not just missing something obvious and they were not having the same problem. We tries several things but what it boiled down to was there was something in my installation that was causing it to fail (no idea what), so I de-installed Go, de-installed git, re-installed Go, and re-installed git, and after cleaning up the configuration issues from re-installation, my problem has gone away. I wish I had a better answer but I do not.
Hopefully nobody else has to go through this.