Go:null judge

Go:null judge

null judge

int 空值是 0,

string 空值是””而不是 null 或者 nil(区别

Slice 空值是长度为 0 的

map 空值是 nil,

error 空值是 nil,

struct 空值是一个“所有成员都是空值”的空 Struct 而不是 nil,

Read more