Skip to content

reflect: Value.Seq|Seq2 documentation and unexported value #74377

Open
@pierrre

Description

@pierrre

Go version

1.24

Output of go env in your module/workspace:

not relevant

What did you do?

Calling reflect.Value.Seq() panics if the value is unexported (CanInterface() returns false), but the documentation doesn't mention it.

What did you see happen?

It panics

What did you expect to see?

The documentation should explain that Seq() and Seq2() can be called if CanInterface() returns true, otherwise it panics.
I guess we should add the same warning to Call() and CallSlice()

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions