static_mock.go 395 B

123456789101112131415161718192021
  1. // +build !cgo
  2. package sqlite3
  3. import (
  4. "database/sql"
  5. "database/sql/driver"
  6. "errors"
  7. )
  8. func init() {
  9. sql.Register("sqlite3", &SQLiteDriverMock{})
  10. }
  11. type SQLiteDriverMock struct{}
  12. var errorMsg = errors.New("Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub")
  13. func (SQLiteDriverMock) Open(s string) (driver.Conn, error) {
  14. return nil, errorMsg
  15. }