-
Notifications
You must be signed in to change notification settings - Fork 19k
reflect: Value.Seq|Seq2 documentation and unexported value #74377
Copy link
Copy link
Open
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.SuggestedIssues that may be good for new contributors looking for work to do.Issues that may be good for new contributors looking for work to do.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.help wanted
Milestone
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.SuggestedIssues that may be good for new contributors looking for work to do.Issues that may be good for new contributors looking for work to do.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.help wanted
Type
Projects
Status
In Progress
Go version
1.24
Output of
go envin your module/workspace: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()andSeq2()can be called ifCanInterface()returns true, otherwise it panics.I guess we should add the same warning to
Call()andCallSlice()