MCPcopy
hub / github.com/tailscale/tailscale / Scan

Method Scan

types/opt/bool.go:61–84  ·  view source on GitHub ↗

Scan implements database/sql.Scanner.

(src any)

Source from the content-addressed store, hash-verified

59
60// Scan implements database/sql.Scanner.
61func (b *Bool) Scan(src any) error {
62 if src == nil {
63 *b = ""
64 return nil
65 }
66 switch src := src.(type) {
67 case bool:
68 if src {
69 *b = True
70 } else {
71 *b = False
72 }
73 return nil
74 case int64:
75 if src == 0 {
76 *b = False
77 } else {
78 *b = True
79 }
80 return nil
81 default:
82 return fmt.Errorf("opt.Bool.Scan: invalid type %T: %v", src, src)
83 }
84}
85
86// Normalized returns the normalized form of b, mapping "unset" to ""
87// and leaving other values unchanged.

Callers 15

handleGameFunction · 0.80
installSystemdFunction · 0.80
cleanAllTailscaleRoutesFunction · 0.80
readMacosSameUserProofFunction · 0.80
TestAuditIntegrationFunction · 0.80
testFuncNamesFunction · 0.80
runTestsFunction · 0.80
runOneTestFunction · 0.80
mainFunction · 0.80
runDaemonMetricsFunction · 0.80

Calls 1

ErrorfMethod · 0.65

Tested by 4

TestAuditIntegrationFunction · 0.64
newTestchainFunction · 0.64
handleMethod · 0.64