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.

static_mock.go 567B

1234567891011121314151617181920212223242526
  1. // Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
  2. //
  3. // Use of this source code is governed by an MIT-style
  4. // license that can be found in the LICENSE file.
  5. // +build !cgo
  6. package sqlite3
  7. import (
  8. "database/sql"
  9. "database/sql/driver"
  10. "errors"
  11. )
  12. func init() {
  13. sql.Register("sqlite3", &SQLiteDriverMock{})
  14. }
  15. type SQLiteDriverMock struct{}
  16. var errorMsg = errors.New("Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub")
  17. func (SQLiteDriverMock) Open(s string) (driver.Conn, error) {
  18. return nil, errorMsg
  19. }