postgresql/null/set.go

35 lines
435 B
Go
Raw Permalink Normal View History

2022-10-04 04:19:25 +00:00
package null
import (
"github.com/volatiletech/null/v8"
"time"
)
func SetString(val string) null.String {
return null.String{
String: val,
Valid: true,
}
}
func SetInt(val int) null.Int {
return null.Int{
Int: val,
Valid: true,
}
}
func SetBool(val bool) null.Bool {
return null.Bool{
Bool: val,
Valid: true,
}
}
func SetTime(val time.Time) null.Time {
return null.Time{
Time: val,
Valid: true,
}
}