MCPcopy Index your code
hub / github.com/aarondl/sqlboiler / Scan

Method Scan

types/byte.go:48–61  ·  view source on GitHub ↗

Scan stores the src in *b.

(src any)

Source from the content-addressed store, hash-verified

46
47// Scan stores the src in *b.
48func (b *Byte) Scan(src any) error {
49 switch src.(type) {
50 case uint8:
51 *b = Byte(src.(uint8))
52 case string:
53 *b = Byte(src.(string)[0])
54 case []byte:
55 *b = Byte(src.([]byte)[0])
56 default:
57 return errors.New("incompatible type for byte")
58 }
59
60 return nil
61}
62
63// Randomize for sqlboiler
64func (b *Byte) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool) {

Calls 1

ByteTypeAlias · 0.85