Navigation Menu

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/doc: usage() #34976

Closed
gertcuykens opened this issue Oct 18, 2019 · 4 comments
Closed

cmd/doc: usage() #34976

gertcuykens opened this issue Oct 18, 2019 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@gertcuykens
Copy link
Contributor

gertcuykens commented Oct 18, 2019

Fixes usage inconsistency between

/usr/local/go/src/cmd/doc/main.go

func usage() {
	fmt.Fprintf(os.Stderr, "Usage of [go] doc:\n")
	fmt.Fprintf(os.Stderr, "\tgo doc\n")
	fmt.Fprintf(os.Stderr, "\tgo doc <pkg>\n")
	fmt.Fprintf(os.Stderr, "\tgo doc <pkg> <sym>[.<method>]\n")
	fmt.Fprintf(os.Stderr, "\tgo doc [<pkg>.][<sym>.]<method>\n")
	fmt.Fprintf(os.Stderr, "\tgo doc <sym>[.<method>]\n")
	fmt.Fprintf(os.Stderr, "For more information run\n")
	fmt.Fprintf(os.Stderr, "\tgo help doc\n\n")
	fmt.Fprintf(os.Stderr, "Flags:\n")
	flag.PrintDefaults()
	os.Exit(2)
}

/usr/local/go/src/cmd/go/internal/doc/doc.go

	go doc <pkg>
	go doc <pkg> <sym>[.<methodOrField>]
	go doc [<pkg>.][<sym>.]<methodOrField>
	go doc <sym>[.<methodOrField>]

see diff https://golang.org/cl/201857 for details
Note that the original [<pkg>].<sym>[.<method>] was definitely a typo ]. vs .] ,just trying to make it identical while i was at it fixing that.

Also note https://groups.google.com/forum/#!topic/golang-nuts/OFg-02kfpno Compared to go help doc output, it seems flag.PrintDefaults() messes up flags descriptions new lines of go doc --help? But thats probably a separate issue with flag.PrintDefaults()

@gopherbot
Copy link

Change https://golang.org/cl/201857 mentions this issue: cmd/doc: usage()

@julieqiu
Copy link
Member

/cc @jayconrod @bcmills

@julieqiu julieqiu added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 18, 2019
@gertcuykens
Copy link
Contributor Author

@julieqiu please add label Go 1.14 and remove needsInvestigation before this patch gets forgotten

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 13, 2019
@bcmills bcmills added this to the Backlog milestone Dec 13, 2019
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 13, 2019
@bcmills
Copy link
Contributor

bcmills commented Dec 13, 2019

@gertcuykens, as far as I can tell this fix doesn't need to hold up the 1.14 release if it isn't ready, so the Go1.14 milestone probably isn't appropriate. (But it's small and cosmetic enough that it can probably make 1.14 anyway.)

@golang golang locked and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants