Standard library / database/sql/driver

driver.String

Converts values to strings or byte slices according to the converter contract. Expected stdout: '7\n'.

Formal Syntax & Structure

go syntaxgo
var String stringType

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.String.ConvertValue(7))) }
Go Reference