1 package example 2 3 import "reflect" 4 5 func describe(v interface{}) string { 6 t := reflect.TypeOf(v) 7 return t.String() 8 } 9 10 func cast(v any) string { 11 s, ok := v.(string) 12 if ok { 13 return s 14 } 15 return "" 16 } 17 18 type Printer interface { 19 Print(msg string) 20 } 21 22 func printAll(items []interface{}) { 23 for _, item := range items { 24 _ = item 25 } 26 } 27