This is specific for: https://github.com/twitchtv/twirp
This library is currently on version v7, and we would like to migrate it into go modules. The library is currently imported from other libraries like this:
// go.mod
require github.com/twitchtv/twirp v7.2.0+incompatible
// .go code
import "github.com/twitchtv/twirp"
If we add a go.mod
file in the library, now every other library is forced to change the import paths like this:
// go.mod
require github.com/twitchtv/twirp v7.2.0
// .go code
import "github.com/twitchtv/twirp/v7"
How can we migrate the Twirp library to use go modules without forcing other libraries to update their import path?
The main issue here is that a single service may import multiple Twirp clients that were generated on different versions, and make use of helper functions that depend on specific types. Forcing the import path update would force all those helper functions to require managing both the old and new types, and we can't make aliases for all types (some types are functions). This would create an upgrade lock. Does this mean that the Twirp library needs to stay in +incompatible
mode forever?