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
| Name | Type | Description |
|---|---|---|
| v | any | Input 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)}