]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: add available godoc link
authorcui fliter <imcusg@gmail.com>
Fri, 3 Nov 2023 11:33:51 +0000 (19:33 +0800)
committerGopher Robot <gobot@golang.org>
Tue, 2 Apr 2024 15:20:05 +0000 (15:20 +0000)
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>
src/reflect/arena.go
src/reflect/makefunc.go
src/reflect/type.go
src/reflect/value.go

index cac1a1da5eaaeff243eea1d2f2894740dbc48410..769f8ebc74011de6fd79b2ccd3fd3b47a6e05023 100644 (file)
@@ -8,9 +8,9 @@ package reflect
 
 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,
-// the returned Value's Type is PointerTo(typ).
+// the returned Value's Type is [PointerTo](typ).
 func ArenaNew(a *arena.Arena, typ Type) Value {
        return ValueOf(arena_New(a, PointerTo(typ)))
 }
index 2ed7f3890588f4e10e80f2f2b9bd8c35e4c139e5..5da6cd2ec7d4eaf1eedcce11f8851e14ce0f784e 100644 (file)
@@ -22,7 +22,7 @@ type makeFuncImpl struct {
        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
 // does the following:
 //
@@ -30,14 +30,14 @@ type makeFuncImpl struct {
 //   - runs results := fn(args).
 //   - 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.
 // If typ describes a variadic function, the final Value is itself
 // a slice representing the variadic arguments, as in the
 // body of a variadic function. The result Value slice returned by fn
 // 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
 // a typed function in terms of Values.
 //
index 4e650f765cfb72658b1fca7d644a12f90686643b..4a8c5a1e09f254222e4d8fc2465b8be851253ae7 100644 (file)
@@ -962,7 +962,7 @@ type StructTag 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
 // 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 {
        v, _ := tag.Lookup(key)
        return v
index 5fa2daae86fac26671a81e5575b11dbadc13a60f..9cde9d0975436214100e4638f07a32e6d5dca25c 100644 (file)
@@ -24,7 +24,7 @@ import (
 // inappropriate to the kind of type causes a run time panic.
 //
 // 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.
 // Most functions and methods never return an invalid value.
 // 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
 // not, IsNil panics. Note that IsNil is not always equivalent to a
 // 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
 // Value.
 func (v Value) IsNil() bool {
@@ -1566,7 +1566,7 @@ func (v Value) IsNil() bool {
 
 // IsValid reports whether v represents a 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.
 // If one does, its documentation states the conditions explicitly.
 func (v Value) IsValid() bool {
@@ -2503,7 +2503,7 @@ func (v Value) SetUint(x uint64) {
 }
 
 // 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) {
        v.mustBeAssignable()
        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
 // 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.
 // 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.
@@ -3281,7 +3281,7 @@ func Zero(typ Type) Value {
 var zeroVal [abi.ZeroValSize]byte
 
 // 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 {
        if typ == nil {
                panic("reflect: New(nil)")