Last updated 5 years ago
Was this helpful?
fmt.Sprintf("%T", v)
反射 reflect.TypeOf(v).String()
reflect.TypeOf(v).String()
断开断言
switch v.(type) { case int: return "int" case uint: return "uint" default: _ = v return "unknown" }