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

Method EncodeSQLNullBool

encode_sqlnull.go:292–303  ·  view source on GitHub ↗

NullBool EncodeSQLNullBool encodes a string to

(v *sql.NullBool)

Source from the content-addressed store, hash-verified

290
291// EncodeSQLNullBool encodes a string to
292func (enc *Encoder) EncodeSQLNullBool(v *sql.NullBool) error {
293 if enc.isPooled == 1 {
294 panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
295 }
296 _, _ = enc.encodeBool(v.Bool)
297 _, err := enc.Write()
298 if err != nil {
299 enc.err = err
300 return err
301 }
302 return nil
303}
304
305// AddSQLNullBool adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key)
306func (enc *Encoder) AddSQLNullBool(v *sql.NullBool) {

Callers 1

TestEncoceSQLNullBoolFunction · 0.95

Calls 3

encodeBoolMethod · 0.95
WriteMethod · 0.95

Tested by 1

TestEncoceSQLNullBoolFunction · 0.76