package main
import "fmt"
func type_switches(i interface{}) {
switch val := i.(type) {
case int:
fmt.Printf("int: %v\n", val)
case string:
fmt.Printf("string: %q\n", val)
default:
fmt.Printf("default: %T\n", val)
}
}
func main() {
type_switches(83445)
type_switches("go")
type_switches(true)
}
/*
run:
int: 83445
string: "go"
default: bool
*/