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/link: go doc cmd/link and go tool link -h see different options #72086

Open
linsite opened this issue Mar 4, 2025 · 4 comments
Open

cmd/link: go doc cmd/link and go tool link -h see different options #72086

linsite opened this issue Mar 4, 2025 · 4 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation Issues describing a change to documentation. help wanted NeedsFix The path to resolution is known, but the work has not been done. Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@linsite
Copy link
Contributor

linsite commented Mar 4, 2025

by roughly checking , go tool link -h at least has -randlayout, -capturehostobjs,-benchmark, -benchmarkprofile options which go doc cmd/link doesn't.

go version devel go1.25-fbfc9e09cb Thu Feb 27 08:22:57 2025 +0800 linux/arm64

is this intended or should be consistent?

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Mar 4, 2025
@gabyhelp gabyhelp added the Documentation Issues describing a change to documentation. label Mar 4, 2025
@ianlancetaylor
Copy link
Member

It should be kept consistent.

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 4, 2025
@mknyszek mknyszek added this to the Backlog milestone Mar 12, 2025
@mknyszek mknyszek added help wanted Suggested Issues that may be good for new contributors looking for work to do. labels Mar 12, 2025
@mknyszek mknyszek changed the title cmd/link: go doc cmd/link and go tool link -h see different options cmd/link: go doc cmd/link and go tool link -h see different options Mar 12, 2025
@obeyda
Copy link
Contributor

obeyda commented Mar 27, 2025

Hi,
I would like to fix this issue. After reviewing both commands output the following flags are present in go tool link -h but were missing in go doc cmd/link:

  • -a
  • -benchmark
  • -benchmarkprofile
  • -capturehostobjs
  • -debugnosplit
  • -debugtextsize
  • -debugtramp
  • -fipso
  • -h
  • -n
  • -pruneweakmap
  • -randlayout
  • -strictdups

I think fixing this should be as simple as taking the output from go tool link -h and updating the src/cmd/link/doc.go file directly.
I'll push a CL soon with these changes and would appreciate feedback.

@linsite
Copy link
Contributor Author

linsite commented Mar 27, 2025

Hi, I would like to fix this issue. After reviewing both commands output the following flags are present in go tool link -h but were missing in go doc cmd/link:

  • -a
  • -benchmark
  • -benchmarkprofile
  • -capturehostobjs
  • -debugnosplit
  • -debugtextsize
  • -debugtramp
  • -fipso
  • -h
  • -n
  • -pruneweakmap
  • -randlayout
  • -strictdups

I think fixing this should be as simple as taking the output from go tool link -h and updating the src/cmd/link/doc.go file directly. I'll push a CL soon with these changes and would appreciate feedback.

Thanks, feel free to go for it.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/661235 mentions this issue: cmd/link: update doc.go to include all flags present in -h output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation Issues describing a change to documentation. help wanted NeedsFix The path to resolution is known, but the work has not been done. Suggested Issues that may be good for new contributors looking for work to do.
Projects
Development

No branches or pull requests

6 participants