/usr/share/gocode/src/github.com/erikstmartin/go-testdb/stmt.go is in golang-github-erikstmartin-go-testdb-dev 0.0~git20160219.0.8d10e4a-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | package testdb
import (
"database/sql/driver"
)
type stmt struct {
queryFunc func(args []driver.Value) (driver.Rows, error)
execFunc func(args []driver.Value) (driver.Result, error)
}
func (s *stmt) Close() error {
return nil
}
func (s *stmt) NumInput() int {
// This prevents the sql package from validating the number of inputs
return -1
}
func (s *stmt) Exec(args []driver.Value) (driver.Result, error) {
return s.execFunc(args)
}
func (s *stmt) Query(args []driver.Value) (driver.Rows, error) {
return s.queryFunc(args)
}
|