Skip to content
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

unify import paths under /v4 #62

Closed
wants to merge 1 commit into from
Closed

unify import paths under /v4 #62

wants to merge 1 commit into from

Conversation

acln0
Copy link
Member

@acln0 acln0 commented Nov 20, 2018

Create a new /v4 directory, containing a copy of the existing code,
allowing the package to move forward and be consumed by all users
under a unified import path: github.com/gofrs/uuid/v4.

Remove go.mod file from the top level directory and add it to the v4
directory. Update v3 to v4 in go.mod.

Update documentation to reflect the change: Recommend v4.0.0+ as the
go-to version for new users and existing modules users. Recommend
v2.1.0 under github.com/gofrs/uuid as the go-to version for users
looking for a replacement for satori/go.uuid at v1.2.0. Document the
two different import paths and their behavior.

Fixes #61.

Create a new /v4 directory, containing a copy of the existing code,
allowing the package to move forward and be consumed by all users
under a unified import path: github.com/gofrs/uuid/v4.

Remove go.mod file from the top level directory and add it to the v4
directory. Update v3 to v4 in go.mod.

Update documentation to reflect the change: Recommend v4.0.0+ as the
go-to version for new users and existing modules users. Recommend
v2.1.0 under github.com/gofrs/uuid as the go-to version for users
looking for a replacement for satori/go.uuid at v1.2.0. Document the
two different import paths and their behavior.

Fixes #61.
@acln0 acln0 requested a review from theckman November 20, 2018 06:30
Copy link
Member

@theckman theckman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, no.

@acln0
Copy link
Member Author

acln0 commented Nov 20, 2018

You're welcome to try to talk the actual users out of it in #61, then.

@niaow
Copy link
Member

niaow commented Nov 20, 2018

Could we use a symlink?

@zerkms
Copy link
Member

zerkms commented Nov 20, 2018

@jadr2ddude on windows git would not create a symlink

@niaow
Copy link
Member

niaow commented Nov 20, 2018

Ok. Ugh.

Copy link
Member

@adamdecaf adamdecaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like Git on windows supports symlinks now, but perhaps only for newer versions? Can we try? I don't have a Windows machine handy this week.

https://github.community/t5/How-to-use-Git-and-GitHub/Windows-symlinks-do-they-play-well-with-Git-projects/td-p/4964

@myitcv
Copy link

myitcv commented Nov 21, 2018

@theckman

Please, no.

Can you be more specific about what it is you are objecting to here?

@acln0 has, to my mind, taken the right step of distilling a concrete straw-man PR out of the advice from @bcmills and @thepudds in #61. Constructive comments on where that straw-man deviates from the advice would probably be more useful. Else, if it's the advice you disagree with, I'd suggest we continue the discussion in #61.

acln0 added a commit that referenced this pull request Nov 22, 2018
In #61, @bcmills describes one possible solution to the current
import path conundrum:

> Hmm, come to think of it, you might not even need to switch to major
> version 4. You could make v3.2.0 a forwarding package (without a
> go.mod) to github.com/gofrs/uuid/v3), with a corresponding v3.3.0
> (with a go.mod) that provides the /v3 module.

This patch is a demo of the first phase of this solution. It removes
the go.mod file, moves existing code to the new /v3 subdirectory,
and adds a forward.go file in the root directory, with forwarding
declarations and type aliases, targetting /v3.

For discussion and comparison with the approach in #62.
@theckman
Copy link
Member

theckman commented Dec 3, 2018

@myitcv I believe in "A little copying is better than a little dependency", but I'm adamantly against versioned subdirectories and the subsequent code copying. I want to make use of the repository's metadata for version information and not directory structure.

@myitcv
Copy link

myitcv commented Dec 3, 2018

@theckman

but I'm adamantly against versioned subdirectories and the subsequent code copying

Did you see #61 (comment) which confirms:

Note that /v4 doesn't have to be a copy. It can forward functions and types back to the non-/v4 path, or you can move (not copy) the code to /v4 and rewrite the non-/v4 path to forward to /v4. Either would reduce the maintenance overhead, since bug-fixes in one path would automatically apply to the other as well. (That's what the goforward tool is for.)

@acln0
Copy link
Member Author

acln0 commented Dec 5, 2018

Abandoning in favor of #66.

@acln0 acln0 closed this Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants