reflect: add available godoc link

Change-Id: Ib199ce1a781e8e3a66d3dc8bda617e6bc30b290e
Reviewed-on: https://go-review.googlesource.com/c/go/+/539578
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
This commit is contained in:
cui fliter 2023-11-03 19:33:51 +08:00 committed by Gopher Robot
parent daaf1f2220
commit e0cd90528e
4 changed files with 12 additions and 12 deletions

View file

@ -8,9 +8,9 @@ package reflect
import "arena" import "arena"
// ArenaNew returns a Value representing a pointer to a new zero value for the // ArenaNew returns a [Value] representing a pointer to a new zero value for the
// specified type, allocating storage for it in the provided arena. That is, // specified type, allocating storage for it in the provided arena. That is,
// the returned Value's Type is PointerTo(typ). // the returned Value's Type is [PointerTo](typ).
func ArenaNew(a *arena.Arena, typ Type) Value { func ArenaNew(a *arena.Arena, typ Type) Value {
return ValueOf(arena_New(a, PointerTo(typ))) return ValueOf(arena_New(a, PointerTo(typ)))
} }

View file

@ -22,7 +22,7 @@ type makeFuncImpl struct {
fn func([]Value) []Value fn func([]Value) []Value
} }
// MakeFunc returns a new function of the given Type // MakeFunc returns a new function of the given [Type]
// that wraps the function fn. When called, that new function // that wraps the function fn. When called, that new function
// does the following: // does the following:
// //
@ -30,14 +30,14 @@ type makeFuncImpl struct {
// - runs results := fn(args). // - runs results := fn(args).
// - returns the results as a slice of Values, one per formal result. // - returns the results as a slice of Values, one per formal result.
// //
// The implementation fn can assume that the argument Value slice // The implementation fn can assume that the argument [Value] slice
// has the number and type of arguments given by typ. // has the number and type of arguments given by typ.
// If typ describes a variadic function, the final Value is itself // If typ describes a variadic function, the final Value is itself
// a slice representing the variadic arguments, as in the // a slice representing the variadic arguments, as in the
// body of a variadic function. The result Value slice returned by fn // body of a variadic function. The result Value slice returned by fn
// must have the number and type of results given by typ. // must have the number and type of results given by typ.
// //
// The Value.Call method allows the caller to invoke a typed function // The [Value.Call] method allows the caller to invoke a typed function
// in terms of Values; in contrast, MakeFunc allows the caller to implement // in terms of Values; in contrast, MakeFunc allows the caller to implement
// a typed function in terms of Values. // a typed function in terms of Values.
// //

View file

@ -962,7 +962,7 @@ type StructTag string
// If there is no such key in the tag, Get returns the empty string. // If there is no such key in the tag, Get returns the empty string.
// If the tag does not have the conventional format, the value // If the tag does not have the conventional format, the value
// returned by Get is unspecified. To determine whether a tag is // returned by Get is unspecified. To determine whether a tag is
// explicitly set to the empty string, use Lookup. // explicitly set to the empty string, use [StructTag.Lookup].
func (tag StructTag) Get(key string) string { func (tag StructTag) Get(key string) string {
v, _ := tag.Lookup(key) v, _ := tag.Lookup(key)
return v return v

View file

@ -24,7 +24,7 @@ import (
// inappropriate to the kind of type causes a run time panic. // inappropriate to the kind of type causes a run time panic.
// //
// The zero Value represents no value. // The zero Value represents no value.
// Its IsValid method returns false, its Kind method returns Invalid, // Its [Value.IsValid] method returns false, its Kind method returns [Invalid],
// its String method returns "<invalid Value>", and all other methods panic. // its String method returns "<invalid Value>", and all other methods panic.
// Most functions and methods never return an invalid value. // Most functions and methods never return an invalid value.
// If one does, its documentation states the conditions explicitly. // If one does, its documentation states the conditions explicitly.
@ -1541,7 +1541,7 @@ func (v Value) InterfaceData() [2]uintptr {
// a chan, func, interface, map, pointer, or slice value; if it is // a chan, func, interface, map, pointer, or slice value; if it is
// not, IsNil panics. Note that IsNil is not always equivalent to a // not, IsNil panics. Note that IsNil is not always equivalent to a
// regular comparison with nil in Go. For example, if v was created // regular comparison with nil in Go. For example, if v was created
// by calling ValueOf with an uninitialized interface variable i, // by calling [ValueOf] with an uninitialized interface variable i,
// i==nil will be true but v.IsNil will panic as v will be the zero // i==nil will be true but v.IsNil will panic as v will be the zero
// Value. // Value.
func (v Value) IsNil() bool { func (v Value) IsNil() bool {
@ -1566,7 +1566,7 @@ func (v Value) IsNil() bool {
// IsValid reports whether v represents a value. // IsValid reports whether v represents a value.
// It returns false if v is the zero Value. // It returns false if v is the zero Value.
// If IsValid returns false, all other methods except String panic. // If [Value.IsValid] returns false, all other methods except String panic.
// Most functions and methods never return an invalid Value. // Most functions and methods never return an invalid Value.
// If one does, its documentation states the conditions explicitly. // If one does, its documentation states the conditions explicitly.
func (v Value) IsValid() bool { func (v Value) IsValid() bool {
@ -2503,7 +2503,7 @@ func (v Value) SetUint(x uint64) {
} }
// SetPointer sets the [unsafe.Pointer] value v to x. // SetPointer sets the [unsafe.Pointer] value v to x.
// It panics if v's Kind is not UnsafePointer. // It panics if v's Kind is not [UnsafePointer].
func (v Value) SetPointer(x unsafe.Pointer) { func (v Value) SetPointer(x unsafe.Pointer) {
v.mustBeAssignable() v.mustBeAssignable()
v.mustBe(UnsafePointer) v.mustBe(UnsafePointer)
@ -3054,7 +3054,7 @@ const (
// then the case is ignored, and the field Send will also be ignored and may be either zero // then the case is ignored, and the field Send will also be ignored and may be either zero
// or non-zero. // or non-zero.
// //
// If Dir is SelectRecv, the case represents a receive operation. // If Dir is [SelectRecv], the case represents a receive operation.
// Normally Chan's underlying value must be a channel and Send must be a zero Value. // Normally Chan's underlying value must be a channel and Send must be a zero Value.
// If Chan is a zero Value, then the case is ignored, but Send must still be a zero Value. // If Chan is a zero Value, then the case is ignored, but Send must still be a zero Value.
// When a receive operation is selected, the received Value is returned by Select. // When a receive operation is selected, the received Value is returned by Select.
@ -3281,7 +3281,7 @@ func Zero(typ Type) Value {
var zeroVal [abi.ZeroValSize]byte var zeroVal [abi.ZeroValSize]byte
// New returns a Value representing a pointer to a new zero value // New returns a Value representing a pointer to a new zero value
// for the specified type. That is, the returned Value's Type is PointerTo(typ). // for the specified type. That is, the returned Value's Type is [PointerTo](typ).
func New(typ Type) Value { func New(typ Type) Value {
if typ == nil { if typ == nil {
panic("reflect: New(nil)") panic("reflect: New(nil)")