I have been working on converting our private library into a go module and have overcome the new issues of publishing and using the library Initial hurdles to major releases (e.g. tssgit.reyrey.com/teschste/go-httpmailer/v3
).
However, I now need to release an update of the library from v3.0.0 to v3.1.0 and I'm running into a problem. My understanding, based on the information I've found online, is that I keep the declaration in the same module tssgit.reyrey.com/teschste/go-httpmailer/v3
in my go.mod and simply publish new version. I can see the new version in our repository:
[I tried adding an image to show it but for some reason it won't add]
When I try to use this new version in my application, I first try:
go get tssgit.reyrey.com/teschste/go-httpmailer/v3
but failed:
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/[email protected]
but failed:
go: tssgit.reyrey.com/teschste/go-httpmailer/[email protected]: 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 so far I haven't found anything that solves my specific problem. I'm sure I'm missing something simple, but currently I don't know what it is. Any help would be greatly appreciated!
After some more googling, I asked for some help from others internally to make sure I wasn't just missing something obvious, And they don't have the same problem. We tried a few things, but it came down to something in my installation that was causing it to fail (don't know what), so I uninstalled Go, uninstalled git, reinstalled Go, then reinstalled git, after clearing After reinstalling the configuration issue, my problem disappeared. I wish I had a better answer, but I don't.
Hope no one else needs to go through this.
The above is the detailed content of Adding and using Go module library minor versions (major versions > 2). For more information, please follow other related articles on the PHP Chinese website!