我有一个变量数据,它是一个接口。当我打印其类型时,将其获取为json.Number。如何将强制类型转换为int / int64 / float64
如果我尝试数据。(float64),最终会出现紧急错误
panic: interface conversion: interface {} is json.Number, not float64
go go-interface
go ×1
go-interface ×1