fmt.Println(reflect.TypeOf(var)) 

 

switch xxx.(type){

  case int:....

  case float32:...

  case float64:...

  case string:...

}

对type的枚举,不能使用fallthrough,且float32和float64是两个不同的类型(没有单独的float类型),而int却包含int64

相关文章:

  • 2022-02-09
  • 2022-01-24
  • 2021-12-19
  • 2022-12-23
  • 2021-11-14
  • 2021-06-23
  • 2022-12-23
猜你喜欢
  • 2021-11-15
  • 2019-01-11
  • 2021-12-19
  • 2022-03-03
  • 2022-12-23
  • 2021-11-14
  • 2022-01-17
相关资源
相似解决方案