datatypes
datatypes copied to clipboard
null 会被写入成 'null',会无法反序列化,需要添加或 判断string(j) == "null"
func (j RawJson) Value() (driver.Value, error) {
if len(j) == 0 || string(j) == "null" {
return nil, nil
}
bytes, err := j.MarshalJSON()
return string(bytes), err
}