MCPcopy Create free account
hub / github.com/francoispqt/gojay / SQLNullBool

Method SQLNullBool

decode_sqlnull.go:145–157  ·  view source on GitHub ↗

SQLNullBool decodes the JSON value within an object or an array to an *sql.NullBool

(v *sql.NullBool)

Source from the content-addressed store, hash-verified

143
144// SQLNullBool decodes the JSON value within an object or an array to an *sql.NullBool
145func (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}

Callers 1

AddSQLNullBoolMethod · 0.95

Calls 1

BoolNullMethod · 0.95

Tested by

no test coverage detected