version: unexport all vars, turn Short/Long into funcs
The other formerly exported values aren't used outside the package, so just unexport them. Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
committed by
Dave Anderson
parent
9e6b4d7ad8
commit
8b2ae47c31
+1
-1
@@ -52,7 +52,7 @@ func Debugger(mux *http.ServeMux) *DebugHandler {
|
||||
mux.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
|
||||
|
||||
ret.KVFunc("Uptime", func() any { return Uptime() })
|
||||
ret.KV("Version", version.Long)
|
||||
ret.KV("Version", version.Long())
|
||||
ret.Handle("vars", "Metrics (Go)", expvar.Handler())
|
||||
ret.Handle("varz", "Metrics (Prometheus)", http.HandlerFunc(VarzHandler))
|
||||
ret.Handle("pprof/", "pprof", http.HandlerFunc(pprof.Index))
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import (
|
||||
|
||||
func init() {
|
||||
expvar.Publish("process_start_unix_time", expvar.Func(func() any { return timeStart.Unix() }))
|
||||
expvar.Publish("version", expvar.Func(func() any { return version.Long }))
|
||||
expvar.Publish("version", expvar.Func(func() any { return version.Long() }))
|
||||
expvar.Publish("go_version", expvar.Func(func() any { return runtime.Version() }))
|
||||
expvar.Publish("counter_uptime_sec", expvar.Func(func() any { return int64(Uptime().Seconds()) }))
|
||||
expvar.Publish("gauge_goroutines", expvar.Func(func() any { return runtime.NumGoroutine() }))
|
||||
|
||||
Reference in New Issue
Block a user