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: doc doesn't show exported fields acquired by embedding non-exported types. #27581

Closed
go101 opened this issue Sep 9, 2018 · 1 comment

Comments

@go101
Copy link

go101 commented Sep 9, 2018

What version of Go are you using (go version)?

go version go1.11 linux/amd64

Does this issue reproduce with the latest release?

yes

What did you do?

package foo

type t struct {
	X int
}

type Config struct {
	t
	Y int
}
$ go doc foo.Config

What did you expect to see?

The current output is not bad, but not perfect.
The reason is the field Config.X is also exported, but it is not mentioned in the printed doc.
Users of the foo package must read code to know that the field Config.X is usable.

What did you see instead?

package foo // import "foo"

type Config struct {
	Y int
	// Has unexported fields.
}
@agnivade
Copy link
Contributor

agnivade commented Sep 9, 2018

Duplicate of #6600.

@agnivade agnivade closed this as completed Sep 9, 2018
@golang golang locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants