MCPcopy
hub / github.com/go-sql-driver/mysql / readBool

Function readBool

utils.go:92–102  ·  view source on GitHub ↗

Returns the bool value of the input. The 2nd return value indicates if the input was a valid bool value

(input string)

Source from the content-addressed store, hash-verified

90// Returns the bool value of the input.
91// The 2nd return value indicates if the input was a valid bool value
92func readBool(input string) (value bool, valid bool) {
93 switch input {
94 case "1", "true", "TRUE", "True":
95 return true, true
96 case "0", "false", "FALSE", "False":
97 return false, true
98 }
99
100 // Not a valid bool value
101 return
102}
103
104/******************************************************************************
105* Time related utils *

Callers 3

parseDSNParamsFunction · 0.85
RegisterTLSConfigFunction · 0.85
TestConcurrentFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestConcurrentFunction · 0.68