-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add go.mod functionality #13
base: master
Are you sure you want to change the base?
Conversation
note: this commit should be tagged as version 1 (v1.x.x)
note: this commit should be tagged as version 2 (v2.x.x)
I'm also interested in module support. Why did you choose such a radical rearrangement of the source over the simpler setup from https://research.swtch.com/vgo-module that is basically what is already used, the PRs don't include tags. I'm confused by your tags |
As I already said “to avoid duplicate code”. This is more of a personal opinion though. I prefer to have either a single master branch with corresponding tags or Version branches ( the “major branch” convention)
Yes, sorry I should have made that clear. As you clarified PRs don’t include tags, the authors would need to tag the respective comments as v1.0.0 and v2.0.0 or similar. |
@sambadevi Doesn't removing the |
@sam-github That's correct. Since go modules are supposed to be the default way to go in future golang versions, I assume switching to go.mod would be the preferred way to go. Taken from https://blog.golang.org/using-go-modules
|
I don't think breaking all existing users of a package unnecessarily is the way to transition to modules. The go authors take backwards compatibility and orderly transition pretty seriously, I doubt this is the kind of encouragement they suggest. I guess you'll see if @pborman feels differently. |
My understanding was when a major backwards breaking change is added a new directory is needed and adding a v2 directory is the accepted form. I would like to drop version 1 (main directory) and only have version 2, but that would break existing code. I would actually recommend using my options package (it imports v2) as I think it is my best attempt at making a fully functional, easy to use package that is fully posix compatible. I need to sit down at a computer (not a mobile device) to examine this further. |
any update on this? It's getting frustrating when people depend on my libs that use github.com/pborman/getopt/v2.
This is getting to be enough of a support headache to fork the repo, which I'm actually quite loathe to do (I hate unnecessary forks). There is no longer a supported version of Go that can't use go.mod (and hasn't been for quite a while). FWIW, I have a lot of published /v2 modules that work fine, without the subdirectory. I maintain two branches instead of two directories. Go will look at the github tags, and for people still on v0, if any v1.x.x tags are found, will use the latest of those tags. |
My issue with the proposed change is that it breaks existing programs. I have to say I have personally never liked how go modules work as they make the type of development I do (I work on multiple packages that interact with each other) more challenging. Heck, you can't even call "go get some.module" if you are in a fresh source tree, you heed to say "GO111MODULE=auto go get some.module"! That all said, I would welcome some advice on how to fix the existing go.mod files without breaking existing code. Thanks |
I've updated this module to be go.mod compatible.
This avoids duplicate code while still enabling people to use both versions in their imports.
I'm not sure whether GitHub would add the tags to the PR so I added a small note to the last two commits.
Commit b60e4a5 should be tagged as v1.x.y
Commit 5335d2b should be tagged as v2.x.y