Skip to content

x/tools/cmd/godoc: public fields of a private embedded struct do not appear in GoDoc #59951

Closed as not planned
@ijrsvt

Description

@ijrsvt

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

$ go version
go version go1.20.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOOS="darwin"

What did you do?

I created two structs, one private, one public. I attached a public method to the private struct and then embedded the private struct in the public struct. I can access that public method from elsewhere, but cannot view it in Godoc. Code below:

type min interface {
	Var()
}

type Other interface {
	Something()
}

type Max struct {
	Other
	min
}

What did you expect to see?

  • I expect to see that this in an available method on the public struct.

What did you see instead?

Screenshot 2023-05-03 at 10 33 05 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions