Standard library / database/sql/driver

driver.Bool

Converts supported boolean, integer and string representations; rejects invalid inputs. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
var Bool boolType

Working Example

Example Snippetgo
package main
import (  "database/sql/driver"  "fmt")
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}func main() { fmt.Println(must(driver.Bool.ConvertValue("true"))) }
Go Reference