Go doesn't require a folder for each version. You can simply change go.mod to declare the module as github.com/nemothekid/foolib/v2 or whatever.
That's one of the points of confusion — first that the go.mod module declaration doesn't need to exactly match the module location, and secondly, following this, that using a folder instead is a fallback option.
Go is famous for favouring simplicity in its design, but this is a rare instance where it's not made things simple enough.
That's one of the points of confusion — first that the go.mod module declaration doesn't need to exactly match the module location, and secondly, following this, that using a folder instead is a fallback option.
Go is famous for favouring simplicity in its design, but this is a rare instance where it's not made things simple enough.