Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Support Go Modules not properly integrated #66
I think integration of go modules is good but i think it should not include version/release in path
Issues I have with that is all my code import path was based on github.com/dimfeld/httptreemux and i can used to just call httptreemux.NAME OF FUNC now i have to change all my import path for httptreemux by adding alias like
import httptreemux "github.com/dimfeld/httptreemux/v5"
also in case of creating new version/release you have to change path ?
please take a looks this example: https://github.com/lib/pq
If you don't do this for modules with a major version >1, module support will be broken.
You can still do this; the /v5 is a virtual component of the path, the package name is still httptreemux, so that import you're using (
All versions of Go from 1.9.7+, 1.10.3+, and higher major versions understand the /v5 in the import path, so if you're using a version of Go that's supported and receiving security updates (1.10 or 1.11) you should be fine.
Only on major version releases that break backwards compatibility, in which case having them have two different import lines means you can include both temporarily while you upgrade (eg. you can import /v5 in one place and /v6 in another).
That is still below version 2; you don't include the major version in the path for v1 modules.
If you're having some specific problem with this package, please post the error message and I'll be happy to assist you if it's a modules problem. Thanks!
Thanks, Sam, for the detailed explanation. Unfortunately I can't reset to version 1 since that would break things for everyone else using an older version of the package with some other dependency manager. And even if I did, if I had to make a breaking change in the future, then the version suffix would come back again.
This is just how Go modules works, so I'll close this issue. On the bright side, this package is pretty much in maintenance mode, so breaking changes are pretty rare.