golang/go

reflect: Value.Seq|Seq2 documentation and unexported value

Open

#74 377 ouverte le 25 juin 2025

Voir sur GitHub
 (12 commentaires) (0 réactions) (0 assignés)Go (19 008 forks)batch import
DocumentationFixPendingSuggestedcompiler/runtimehelp wanted

Métriques du dépôt

Stars
 (133 883 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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()

Guide contributeur