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

cmd/go: some documentation issues for new 1.24 'go tool' features #71663

Open
thepudds opened this issue Feb 11, 2025 · 8 comments
Open

cmd/go: some documentation issues for new 1.24 'go tool' features #71663

thepudds opened this issue Feb 11, 2025 · 8 comments
Labels
Documentation Issues describing a change to documentation. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@thepudds
Copy link
Contributor

thepudds commented Feb 11, 2025

  1. "Managing module dependencies":
    a. The text seems to imply -u is needed to upgrade tools, but the -u is not actually needed and often is undesirable. (This was also a problem in the release notes as well; I previously sent https://go.dev/cl/638296 to address in the release notes).

  2. Modules reference:
    a. go get section is missing -tool flag.
    b. go install section doesn't mention go install tool. (It also somewhat implies it wouldn't work because it says 'go install' can't take meta-pattern, which we should also probably tweak).
    c. Most new-ish capabilities have a "Since Go 1.x" or a similar phrase, but the tools description does not (e.g., in https://go.dev/ref/mod#go-mod-file-tool).
    d. No 'go tool' section. (Maybe this is OK for now given the documentation elsewhere, but could include a short section with a link for details).

  3. cmd/go documentation go tool section:
    a. Does not mention needing to use full package path for go tool in some cases.
    b. No mention of go tool without args to list available tools.
    c. No -modfile mentioned (cmd/go: missing flags in help output for tool #71502).
    d. These overlap with the help text shown at the command line in cmd/go.

  4. 1.24 release notes:
    a. Ideally the release notes would mention the -modfile flag. (For example, see #71502, #48429 (comment), or various other recent & older comments on #48429, #33926 and elsewhere).

Opening this issue for discussion. I plan to send some CLs. It seems Go 1.24 official release is very close, so maybe some or all of these are adjustments for later.

For these new capabilities, I think the "Managing Dependencies" doc is currently the most comprehensive and also the easiest to digest, so probably reasonable to link to there from some of the other doc.

There are some other more minor issues, but I wanted to at least try to address some of these. Finally, one additional caveat is this writeup is based on some older notes I had taken, and I need to double-check some of it again.

@gopherbot gopherbot added the Documentation Issues describing a change to documentation. label Feb 11, 2025
@ianlancetaylor
Copy link
Member

CC @matloob @samthanawalla

@ianlancetaylor ianlancetaylor added the GoCommand cmd/go label Feb 11, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/648577 mentions this issue: cmd/go: document -modfile and other flags for 'go tool'

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/648578 mentions this issue: _content/doc/modules/managing-dependencies: remove unneeded '-u' flag and mention '-modfile'

gopherbot pushed a commit that referenced this issue Feb 12, 2025
Mention -modfile, -C, -overlay, and -modcacherw in the 'go tool'
documentation. We let a reference to 'go help build' give a pointer to
more detailed information.

The -modfile flag in particular is newly useful with the Go 1.24 support
for user-defined tools with 'go tool'.

Updates #48429
Updates #33926
Updates #71663
Fixes #71502

Change-Id: Ida67df50ff774a0886733d661a40e27c2cadc0f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/648577
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Conrad Irwin <conrad.irwin@gmail.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Auto-Submit: Sam Thanawalla <samthanawalla@google.com>
@dmitshur dmitshur added this to the Go1.25 milestone Feb 12, 2025
@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 12, 2025
@samthanawalla
Copy link
Contributor

We also need to add some documentation to the website for other Go Command features.

@hu3bi
Copy link

hu3bi commented Feb 25, 2025

Somehow related:

The vscode go extension might also need to be upgraded to accommodate for tools.

After clicking upgrade direct dependencies vscode pulls in a bunch of not needed dependencies, which are removed once you run go mod tidy. This might be confusing, especially for new go developers.
Image

@dolmen
Copy link
Contributor

dolmen commented Mar 6, 2025

@hu3bi Report here: https://github.com/golang/vscode-go

@hu3bi
Copy link

hu3bi commented Mar 6, 2025

@dolmen Thank you and sorry. Should have known better.
golang/vscode-go#3706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues describing a change to documentation. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

8 participants