Open Christian-health opened 5 years ago
package main
import "fmt"
func main() {
var areaIntf interface{}
var a float32 = 10
areaIntf = a
switch t := areaIntf.(type) {
case float32: fmt.Printf("Type float32 with value %v\n", t)
case nil: fmt.Println("nil value: nothing to check?:")
default: fmt.Printf("Unexpected type %T", t)
}
/*
Type float32 with value 10
*/
}