interface 转化为 int

Yishto 2021-08-20 21:46:28
Categories: Tags:

Error :

1
2
panic: interface conversion: interface {} is float64, not int

转化为int, (先转换成float64,在转换为int)

1
2
int(interfaceValue.(float64))