Standard library / database/sql/driver

driver.NotNull.ConvertValue()

Rejects nil and delegates non-nil values to the configured converter. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (n NotNull) ConvertValue(v any) (Value, error)

Parameters & Attributes

NameTypeDescription
vanyInput to the operation as described above.

Return Value

(Value, error)

Rejects nil and delegates non-nil values to the configured converter. Check returned errors where applicable.

Working Example

Example Snippetgo
package main
import (  "database/sql/driver"  "fmt")
func main() {  c := driver.NotNull{Converter: driver.DefaultParameterConverter}  _, e := c.ConvertValue(nil)  fmt.Println(e != nil)}
Go Reference