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: help text for linkmode isn't helpful #40750

Open
mvdan opened this issue Aug 13, 2020 · 2 comments
Open

cmd/link: help text for linkmode isn't helpful #40750

mvdan opened this issue Aug 13, 2020 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mvdan
Copy link
Member

mvdan commented Aug 13, 2020

$ go version
go version devel +5c7748dc9d Mon Aug 10 23:44:58 2020 +0000 linux/amd64
$ go tool link -h 2>&1 | grep -A1 linkmode
  -linkmode mode
    	set link mode

At least, it could tell me what the modes are, and ideally point me at the docs for what they do.

I realise that the compiler and linker are fairly low level and mostusers shouldn't be looking at go tool link -h, but given that -linkmode=external is somewhat well known and widely used, it's confusing that it's hard to find its definition without looking at the code.

CC @cherrymui @jeremyfaller

@ALTree
Copy link
Member

ALTree commented Aug 13, 2020

go doc cmd/link does a slightly better job:

$ go doc cmd/link | grep -A2 linkmode

    -linkmode mode
    	Set link mode (internal, external, auto).
    	This sets the linking mode as described in cmd/cgo/doc.go.

It says what the options are, and it points to a longer explanation in cmd/cgo/doc.go.

@mvdan
Copy link
Member Author

mvdan commented Aug 13, 2020

Oh, right. That sounds more helpful, though I had forgotten about go doc cmd/link and go tool link -h doesn't point me towards it.

Perhaps we could keep go tool link -h in sync with go doc cmd/link, at least when it comes to flags. And for everything else that isn't flags, go tool link -h could tell the user to look at go doc cmd/link.

@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 13, 2020
@andybons andybons added this to the Unplanned milestone Aug 13, 2020
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
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 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants