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
Assignees
Labels
Milestone

Comments

@gertcuykens
Copy link
Contributor

@gertcuykens 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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 18, 2019

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

@julieqiu

This comment has been minimized.

Copy link

@julieqiu julieqiu commented Oct 18, 2019

@gertcuykens

This comment has been minimized.

Copy link
Contributor Author

@gertcuykens gertcuykens commented Dec 13, 2019

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

@bcmills bcmills added the NeedsFix label Dec 13, 2019
@bcmills bcmills added this to the Backlog milestone Dec 13, 2019
@bcmills

This comment has been minimized.

Copy link
Member

@bcmills 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.)

@gopherbot gopherbot closed this in d7b4428 Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.