fix code #4

Merged
nguyenphamquangtue merged 1 commits from feature/fixgetsetupdate into master 2022-10-04 08:57:12 +00:00
1 changed files with 9 additions and 3 deletions
Showing only changes of commit 39267af9ad - Show all commits

12
set.go
View File

@ -19,21 +19,27 @@ func SetInt(val int) null.Int {
}
}
func SetBool(val bool) null.Bool {
func SetBool(val bool) (res null.Bool) {
return null.Bool{
Bool: val,
Valid: true,
}
}
func SetTime(val time.Time) null.Time {
func SetTime(val time.Time) (res null.Time) {
if val.IsZero() {
return
}
return null.Time{
Time: val,
Valid: true,
}
}
func SetJSON(val []byte) null.JSON {
func SetJSON(val []byte) (res null.JSON) {
if val == nil {
return
}
return null.JSON{
JSON: val,
Valid: true,