Your Question

How to distinguish between field is NULL or empty string in the Gorm ?

The document you expected this should be explained

Expected answer

Comment From: tanganyu1114

找到一个解决方案,把结构体里面的string改为sql.Nullstring,然后对获取到的值进行valid判断