go-gorm / go-gorm/datatypes

null 会被写入成 'null',会无法反序列化,需要添加或 判断string(j) == "null"

Open
#66 0 comments 0 reactions 1 assignee Claimed by @jinzhu View on GitHub
Dominant language
Go
Stars
831
Forks
124
PR merge metrics
No merged PRs in 30d

Description

```// Value return json value, implement driver.Valuer interface
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
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.