SQLNullBool decodes the JSON value within an object or an array to an *sql.NullBool
(v *sql.NullBool)
| 143 | |
| 144 | // SQLNullBool decodes the JSON value within an object or an array to an *sql.NullBool |
| 145 | func (dec *Decoder) SQLNullBool(v *sql.NullBool) error { |
| 146 | var b *bool |
| 147 | if err := dec.BoolNull(&b); err != nil { |
| 148 | return err |
| 149 | } |
| 150 | if b == nil { |
| 151 | v.Valid = false |
| 152 | } else { |
| 153 | v.Bool = *b |
| 154 | v.Valid = true |
| 155 | } |
| 156 | return nil |
| 157 | } |
no test coverage detected