1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| var 接口类型变量 interface{} = 数据 switch 接口类型变量.(type) { case bool: ... case float32, float64: ... case int, int32, int64: ... case string: ... case *bool: ... case *float32, *float64: ... case *int, *int32, *int64: ... case *string: ... default: ... }
|