Standard library / database/sql/driver
driver.RowsAffected
Implements a result containing a known affected-row count; LastInsertId is unsupported. Expected stdout: '3\n'.
Formal Syntax & Structure
go syntaxgo
type RowsAffected int64Working 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() { r := driver.RowsAffected(3); fmt.Println(must(r.RowsAffected())) }