小编Ali*_*han的帖子

检查golang中的空float或整数值

我正在尝试检查我的整数或浮点值是否为空.但是抛出了类型错误.

尝试:

if foo == nil    
//Error: cannot convert nil to type float32
//all other methods I Tried also throw type errors too
Run Code Online (Sandbox Code Playgroud)

integer go floating

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

floating ×1

go ×1

integer ×1