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

go modules links #12

Open
bcomnes opened this issue Jul 31, 2018 · 7 comments
Open

go modules links #12

bcomnes opened this issue Jul 31, 2018 · 7 comments

Comments

@bcomnes
Copy link
Owner

bcomnes commented Jul 31, 2018

Main: https://github.com/bcomnes/goref#vgo-go-modules-and-dependencies

Integrate these:

thepudds [7:20 AM]
hi all, one observation is I think a healthy percentage of people aren't generally aware of the official doc that exists (or perhaps are only aware of portions of it, such as 'go help modules' but miss out on 'go help mod'). To my knowledge, it seems the command-line help that people reference most frequently is getting incorporated into the html doc at tip.golang.org, and at least for tip.golang.org, the best current entry point to modules-related documentation on tip.golang.org is this URL:
https://tip.golang.org/cmd/go/#hdr-Modules__module_versions__and_more (edited)
I took a quick stab at marking up the location of the module-related doc on tip.golang.org:

image

I know we are in a transitional phase here, but: (a) does that markup seem useful at least as an overview to orient people to the official doc, and (b) are people here aware of other major sections of module-related doc on tip.golang.org?

Paul Jolly [7:24 AM]
@thepudds to my knowledge, everything module-related should be accessible via go help modules, i.e. it's the starting point for the module journey
So your link above is spot on to my mind

Daniel Martí [7:28 AM]
there's lots of interesting hidden urls :) like dev.golang.org too
or build.golang.org

https://tip.golang.org/cmd/go/#hdr-Pseudo_versions

https://github.com/golang/go/wiki/Modules

go get thing@version talk

golang/go#24250 (comment)

@bcomnes
Copy link
Owner Author

bcomnes commented Aug 31, 2018

v2+ discussion:

golang/go#25967 (comment)

thepudds [10:46 AM]
@uhhyeahbret @marwan91 here is my understanding of how the "magic" works regarding /v2 import paths and Go 1.9.7+ and 1.10.3+:

• Putting major versions in import paths for v2+ modules could create incompatibilities with older versions of Go. To help with this, Go versions 1.9.7+ and 1.10.3+ have been updated so that code built with those releases can properly consume v2+ modules without requiring modification of pre-existing code.
• The updated behavior is that for each package being compiled in a build, the go command determines whether a package lives within a source tree rooted by a go.mod file in order to determine whether or not a package has opted in to modules. If a package has a go.mod file in the root of its source tree, it is considered to have opted in to modules and hence that package should include the major version in the import path for any imported v2+ modules. If there is no go.mod file in the root of a given package's source tree, the package is considered to have not opted in to modules yet and hence the code in that package would not include the major version in the import path for any imported v2+ modules. This works in a mixed build, including when pre-module code and module-based code consume a shared v2+ module.
• In short, the go command "does the right thing", and old code does not need to include the major version in import paths when consuming v2+ modules.

Happy to learn otherwise, or if there is a piece that could use clarification.
@bcmills Is that close to right? ^^^

@bcomnes
Copy link
Owner Author

bcomnes commented Aug 31, 2018

https://github.com/marwan-at-work/mod

Marwan Sulaiman [10:17 AM]
@uhhyeahbret if you just run mod upgrade -t=4 then it will update the go.mod file

@bcomnes
Copy link
Owner Author

bcomnes commented Aug 31, 2018

golang/go#27009 (comment) v2+ confusion

@bcomnes
Copy link
Owner Author

bcomnes commented Aug 31, 2018

Dep complaints
https://www.youtube.com/watch?v=7GGr3S41gjM

@bcomnes
Copy link
Owner Author

bcomnes commented Sep 7, 2018

https://github.com/golang/go/wiki/Modules#semantic-import-versioning

thepudds [7:37 PM]
Go versions 1.9.7+, 1.10.3+ and 1.11 have been updated so that code built with those releases can properly consume v2+ modules without requiring modification of pre-existing code.

thepudds [7:38 PM]
Is that what you were asking about?
v2+ modules are the biggest thorn for old Go versions
(And there is a more awkward and rare-so-far technique to support v2+ modules in even older Go versions like Go 1.8 by creating a new /v2 subdirectory such as my/module/v2 and copying or moving code there)
More details on the overall issue and the updated behavior for 1.9.7+, 1.10.3+ and 1.11 here:
https://github.com/golang/go/wiki/Modules#semantic-import-versioning
(Along with pointers to the related CL and related doc) (edited)

@bcomnes
Copy link
Owner Author

bcomnes commented Feb 24, 2019

@bcomnes
Copy link
Owner Author

bcomnes commented Mar 3, 2019

Depreciating packages https://rakyll.org/deprecated/

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

No branches or pull requests

1 participant