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: document file language version semantics in go help buildconstraint #68161

Closed
findleyr opened this issue Jun 24, 2024 · 3 comments
Closed
Labels
Documentation GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Jun 24, 2024

Discussing with @matloob, we were surprised that https://go.dev/doc/toolchain was the best (only?) canonical documentation we could find for the fact that //go:build go1.22 is not just a build constraint, but also affects the language version within that file.

We should make this more apparent in documentation, by including this information in (at least) go help buildconstraint. It may also be worth mentioning this in go.dev/ref/mod, or other go command documentation.

@gabyhelp
Copy link

Similar Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@findleyr
Copy link
Contributor Author

Helpful @gabyhelp.

Not yet closing as a dupe of #61894 (though it's very closely related), since this issue is about a specific go command help page. But feel free to close this if you'd prefer.

@joedian joedian added GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done. labels Jun 25, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/595475 mentions this issue: cmd/go/internal/help: add documentation for language version downgrading

@dmitshur dmitshur added this to the Go1.23 milestone Jun 27, 2024
Mchnan pushed a commit to Mchnan/go-sylixos that referenced this issue Jul 9, 2024
This change adds documentation for language version downgrading using
build constraints.

Fixes golang#68161
For golang#61894

Change-Id: I283a51afd7020c9fd1f5469a6a93fd814ba32f7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/595475
Reviewed-by: Robert Findley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

5 participants