mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 23:17:29 +00:00
all: use any instead of interface{}
My favorite part of generics. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:

committed by
Josh Bleecher Snyder

parent
5f176f24db
commit
0868329936
@@ -66,7 +66,7 @@ func TestDebuggerKV(t *testing.T) {
|
||||
dbg.KV("Donuts", 42)
|
||||
dbg.KV("Secret code", "hunter2")
|
||||
val := "red"
|
||||
dbg.KVFunc("Condition", func() interface{} { return val })
|
||||
dbg.KVFunc("Condition", func() any { return val })
|
||||
|
||||
code, _ := get(mux, "/debug/", pubIP)
|
||||
if code != 403 {
|
||||
@@ -183,7 +183,7 @@ func ExampleDebugHandler_KVFunc() {
|
||||
// Adds an count of page renders to /debug/. Note this example
|
||||
// isn't concurrency-safe.
|
||||
views := 0
|
||||
dbg.KVFunc("Debug pageviews", func() interface{} {
|
||||
dbg.KVFunc("Debug pageviews", func() any {
|
||||
views = views + 1
|
||||
return views
|
||||
})
|
||||
|
Reference in New Issue
Block a user