You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
395 B

  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. }