-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/website: various mistakes in documentation on modules #44241
Comments
Step 4 on https://golang.org/doc/tutorial/call-module-code tells the user to run
But the actual output starting with Go 1.16 is:
The tutorial should tell the user to ignore the |
https://golang.org/doc/code.html
|
The minor issues (typos, broken links, formatting) are addressed by CL 293229 |
Change https://golang.org/cl/293229 mentions this issue: |
Thank you for reporting this and sending a CL. CC @stevetraut. |
Thanks so much for these fixes, @fzipp! I'll take a look at the CL. |
@stevetraut Points 2, 3, 8, 16, 17, 18 are still open, and some of them are more important, because they break the tutorial experience, but I think they should be addressed by you, because in some cases I don't know what the right answer or best practice is. |
Thanks, @fzipp. I'll take a look. |
For golang/go#44241 Change-Id: Ie23c99c6e36c618d0a3135167cf780f02ea3e3ea Reviewed-on: https://go-review.googlesource.com/c/website/+/293229 Run-TryBot: Steve Traut <straut@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Steve Traut <straut@google.com> Trust: Dmitri Shuralyov <dmitshur@golang.org>
Change https://golang.org/cl/297531 mentions this issue: |
For golang/go#44241 - Fix issues 2, 3, 8, 16, 17, 18 from golang/go#44241 Other changes in multiple topics: - In markdown, replace HTML anchor tags with {#anchor} tags. - In a few places, add content to clarify that module path must be a location from which the module can be downloaded. - Where it was missing, add example.com domain to example module paths. Hopefully, this will reinforce the idea that the module path should typically include a domain. Docs will use something that looks like a domain name for module path. - Add more cross-references from tutorial to references for packages and commands. - Rewrite a few links so that they include the topic title, rather than simply inline text. Left those links whose destinations are references -- the item's name seems to suggest that a reference is at the destination. - Remove domain name from golang.org doc links, leaving root directory. Such as /cmd/go/* or /doc/modules/* - Add path up to root for all links in the same domain. Some were linking by file name only. - Change standard library links from golang.org to pkg.go.dev. Changes in the module tutorial: - Add text to help clarify that there should be a hello and greetings directory as siblings in their directory hierarchy. Some users thought one should be subordinate to the other. - Where needed, reorder steps so that `go mod init` is run before code is added. This is intended to reinforce the importance of the module's presence. - In require/replace steps, have the user use `go mod edit` rather than editing the go.mod file in an editor. The tools are more likely to yield a functioning result. - Where possible/appropriate, change module directive link destinations from "Modules reference" to go.mod reference. - Change "run the code" steps so that they all use `go run .` rather than `go build` or `go run <filename>`. This removes the impedance of explanation and more commands, while moving the explanation of `go build` and `go install` to a separate topic where they share a clearer context. - Add a "Conclusion" topic with a few links. The tutorial ended rather abruptly before. - Minor edits to remove some redundant language. Change-Id: I93055035d73c362ba73edea458fc53bc45e66512 Reviewed-on: https://go-review.googlesource.com/c/website/+/297531 Trust: Steve Traut <straut@google.com> Run-TryBot: Steve Traut <straut@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Added fixes for points 2, 3, 8, 16, 17, and 18. Thanks for the report, @fzipp |
I read the new documentation on modules (which is great, btw) and took notes of mistakes I encountered.
https://golang.org/doc/modules/gomod-ref
Contradiction: The description for 'replacement-path' says:
"[...] If this is a module path, you must specify a _replacement-version_ value. [...]"
But the following example shows the replacement of a module path without a replacement version value:
"
replace example.com/othermodule => example.com/myfork/othermodule
"Section 'exclude', description of 'module-version":
"If this version number is omitted, all versions of the module are replaced with the content on the right side of the arrow."
But an 'exclude' directive doesn't have an arrow. This sentence seems to be copy&pasted from the 'replace' directive and wrong.
Contradiction:
"These directives are ignored in modules that depend on the current module."
vs. later
"These directives are ignored in modules that are dependencies of the current module."
Which one is it?
Formatting: In the first example one line is not correctly indented.
Formatting: "_replacement-version_", "_replacement-path_". The underscores are probably not intended, but unsupported Markdown syntax.
https://golang.org/doc/tutorial/create-module
"This tutorial's sequence includes six brief topics [...]"
Followed by a numbered list of seven topics. s/six/seven/
https://golang.org/doc/tutorial/call-module-code
Broken link: "Here, the replace directive [...]"
Broken tutorial: "In the hello directory, run go build to make Go locate the module and add it as a dependency to the go.mod file."
Starting with Go 1.16 'go build' doesn't add dependencies anymore, which breaks this tutorial (similar to x/website: Getting Started tutorial doesn't work with Go 1.16 #43672).
https://golang.org/doc/tutorial/getting-started
Outdated description: "3. On the Doc tab, under Index, [...]"
The former Doc tab is a menu item named 'Documentation' on the left side now.
https://golang.org/doc/modules/managing-dependencies
Broken link: "See package discovery."
Typo: "One you've discovered" s/One/Once/
https://golang.org/doc/modules/version-numbers
https://golang.org/doc/modules/publishing
Typo: "6. [...] with 1nformation about [...]"
s/1nformation/information/
Broken links: "go get command" (twice)
here: "[ ... ] and run the go get command [...]",
and here: "They can run the go get command [...]
https://golang.org/doc/modules/major-version
Invalid syntax:
"Old import statement:
import example.com/mymodule/package1
New import statement:
import example.com/mymodule/v2/package1
"Package paths must be in quotes.
General
The text was updated successfully, but these errors were encountered: