]> Cypherpunks.ru repositories - gostls13.git/commitdiff
expvar: add available godoc link
authorcui fliter <imcusg@gmail.com>
Fri, 13 Oct 2023 07:04:09 +0000 (15:04 +0800)
committerGopher Robot <gobot@golang.org>
Fri, 13 Oct 2023 20:31:53 +0000 (20:31 +0000)
Change-Id: I2db83e3c97a154f8599b4fcbceeebf1c69ee61ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/534762
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>

src/expvar/expvar.go

index 41ec437af06b5f385a529d7a5cf1ab82fe2ae78d..32e855f6c50bc5cc5679b7fd82f2f25cf13b6b79 100644 (file)
@@ -48,7 +48,7 @@ type jsonVar interface {
        appendJSON(b []byte) []byte
 }
 
-// Int is a 64-bit integer variable that satisfies the Var interface.
+// Int is a 64-bit integer variable that satisfies the [Var] interface.
 type Int struct {
        i int64
 }
@@ -73,7 +73,7 @@ func (v *Int) Set(value int64) {
        atomic.StoreInt64(&v.i, value)
 }
 
-// Float is a 64-bit float variable that satisfies the Var interface.
+// Float is a 64-bit float variable that satisfies the [Var] interface.
 type Float struct {
        f atomic.Uint64
 }
@@ -108,14 +108,14 @@ func (v *Float) Set(value float64) {
        v.f.Store(math.Float64bits(value))
 }
 
-// Map is a string-to-Var map variable that satisfies the Var interface.
+// Map is a string-to-Var map variable that satisfies the [Var] interface.
 type Map struct {
        m      sync.Map // map[string]Var
        keysMu sync.RWMutex
        keys   []string // sorted
 }
 
-// KeyValue represents a single entry in a Map.
+// KeyValue represents a single entry in a [Map].
 type KeyValue struct {
        Key   string
        Value Var
@@ -208,7 +208,7 @@ func (v *Map) Set(key string, av Var) {
        v.m.Store(key, av)
 }
 
-// Add adds delta to the *Int value stored under the given map key.
+// Add adds delta to the *[Int] value stored under the given map key.
 func (v *Map) Add(key string, delta int64) {
        i, ok := v.m.Load(key)
        if !ok {
@@ -225,7 +225,7 @@ func (v *Map) Add(key string, delta int64) {
        }
 }
 
-// AddFloat adds delta to the *Float value stored under the given map key.
+// AddFloat adds delta to the *[Float] value stored under the given map key.
 func (v *Map) AddFloat(key string, delta float64) {
        i, ok := v.m.Load(key)
        if !ok {
@@ -266,7 +266,7 @@ func (v *Map) Do(f func(KeyValue)) {
        }
 }
 
-// String is a string variable, and satisfies the Var interface.
+// String is a string variable, and satisfies the [Var] interface.
 type String struct {
        s atomic.Value // string
 }
@@ -276,8 +276,8 @@ func (v *String) Value() string {
        return p
 }
 
-// String implements the Var interface. To get the unquoted string
-// use Value.
+// String implements the [Var] interface. To get the unquoted string
+// use [String.Value].
 func (v *String) String() string {
        return string(v.appendJSON(nil))
 }
@@ -290,7 +290,7 @@ func (v *String) Set(value string) {
        v.s.Store(value)
 }
 
-// Func implements Var by calling the function
+// Func implements [Var] by calling the function
 // and formatting the returned value using JSON.
 type Func func() any