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

Projects
None yet
2 participants
@go101
Copy link

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

This comment has been minimized.

Copy link
Member

commented Sep 9, 2018

Duplicate of #6600.

@agnivade agnivade closed this Sep 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.