mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
internal/reflectlite: fix comment about meaning of flag field
Copied current (presumably correct) comment text from reflect package. Change-Id: I19582b3675fbcb96a925002498d24ad2b7bc6178 Reviewed-on: https://go-review.googlesource.com/c/go/+/681935 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
parent
816199e421
commit
3254c2bb83
1 changed files with 9 additions and 7 deletions
|
|
@ -43,17 +43,19 @@ type Value struct {
|
||||||
ptr unsafe.Pointer
|
ptr unsafe.Pointer
|
||||||
|
|
||||||
// flag holds metadata about the value.
|
// flag holds metadata about the value.
|
||||||
// The lowest bits are flag bits:
|
//
|
||||||
|
// The lowest five bits give the Kind of the value, mirroring typ.Kind().
|
||||||
|
//
|
||||||
|
// The next set of bits are flag bits:
|
||||||
// - flagStickyRO: obtained via unexported not embedded field, so read-only
|
// - flagStickyRO: obtained via unexported not embedded field, so read-only
|
||||||
// - flagEmbedRO: obtained via unexported embedded field, so read-only
|
// - flagEmbedRO: obtained via unexported embedded field, so read-only
|
||||||
// - flagIndir: val holds a pointer to the data
|
// - flagIndir: val holds a pointer to the data
|
||||||
// - flagAddr: v.CanAddr is true (implies flagIndir)
|
// - flagAddr: v.CanAddr is true (implies flagIndir and ptr is non-nil)
|
||||||
// Value cannot represent method values.
|
// - flagMethod: v is a method value.
|
||||||
// The next five bits give the Kind of the value.
|
|
||||||
// This repeats typ.Kind() except for method values.
|
|
||||||
// The remaining 23+ bits give a method number for method values.
|
|
||||||
// If flag.kind() != Func, code can assume that flagMethod is unset.
|
|
||||||
// If ifaceIndir(typ), code can assume that flagIndir is set.
|
// If ifaceIndir(typ), code can assume that flagIndir is set.
|
||||||
|
//
|
||||||
|
// The remaining 22+ bits give a method number for method values.
|
||||||
|
// If flag.kind() != Func, code can assume that flagMethod is unset.
|
||||||
flag
|
flag
|
||||||
|
|
||||||
// A method value represents a curried method invocation
|
// A method value represents a curried method invocation
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue