From e3337df018dade6469ab297b594cc4a8feda8f6c Mon Sep 17 00:00:00 2001 From: Michele Comignano Date: Sat, 11 Jul 2026 11:47:48 +0200 Subject: [PATCH] use any in switch example --- examples/switch/switch.go | 2 +- examples/switch/switch.hash | 4 ++-- public/switch | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/switch/switch.go b/examples/switch/switch.go index 2d2ec2e2b..42f8eed28 100644 --- a/examples/switch/switch.go +++ b/examples/switch/switch.go @@ -47,7 +47,7 @@ func main() { // can use this to discover the type of an interface // value. In this example, the variable `t` will have the // type corresponding to its clause. - whatAmI := func(i interface{}) { + whatAmI := func(i any) { switch t := i.(type) { case bool: fmt.Println("I'm a bool") diff --git a/examples/switch/switch.hash b/examples/switch/switch.hash index 1bd1eaac2..17b2aff22 100644 --- a/examples/switch/switch.hash +++ b/examples/switch/switch.hash @@ -1,2 +1,2 @@ -28a8909ee7963cb315f14a3be1607def1d91f3a3 -qVDqWoUQ6AI +de11dc85f013921465be1d21619dbee535a884ca +0bvw1aIeuFM diff --git a/public/switch b/public/switch index 7e7b3f658..a337b2f79 100644 --- a/public/switch +++ b/public/switch @@ -45,7 +45,7 @@ branches.

- +
package main
@@ -140,7 +140,7 @@ type corresponding to its clause.

-
    whatAmI := func(i interface{}) {
+          
    whatAmI := func(i any) {
         switch t := i.(type) {
         case bool:
             fmt.Println("I'm a bool")
@@ -192,7 +192,7 @@ type corresponding to its clause.