aboutsummaryrefslogtreecommitdiff
path: root/src/expvar
diff options
context:
space:
mode:
authorcui fliter <imcusg@gmail.com>2023-10-13 15:04:09 +0800
committerGopher Robot <gobot@golang.org>2023-10-13 20:31:53 +0000
commit74f47206cfd004829b6e09f42c2eadd0c1a958cb (patch)
treec340c4e6e29f629f06994fbbbdd8bdb8ac350518 /src/expvar
parent0700bcfa2e997118f82c6c441406e4ff0a573571 (diff)
downloadgo-74f47206cfd004829b6e09f42c2eadd0c1a958cb.tar.gz
go-74f47206cfd004829b6e09f42c2eadd0c1a958cb.zip
expvar: add available godoc link
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>
Diffstat (limited to 'src/expvar')
-rw-r--r--src/expvar/expvar.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/expvar/expvar.go b/src/expvar/expvar.go
index 41ec437af0..32e855f6c5 100644
--- a/src/expvar/expvar.go
+++ b/src/expvar/expvar.go
@@ -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