2
0

Allow setting nil to pgtype.Bool

This commit is contained in:
Tarik Demirci
2018-05-17 12:20:11 +02:00
parent f42b0f65fc
commit 1149b0f015
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -13,6 +13,11 @@ type Bool struct {
}
func (dst *Bool) Set(src interface{}) error {
if src == nil {
*dst = Bool{Status: Null}
return nil
}
switch value := src.(type) {
case bool:
*dst = Bool{Bool: value, Status: Present}