switch to the standard logger
This commit is contained in:
parent
3539433a9d
commit
cc7bdc5b76
11 changed files with 75 additions and 71 deletions
|
|
@ -3,15 +3,13 @@ package storage
|
|||
import (
|
||||
"database/sql"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"log"
|
||||
)
|
||||
|
||||
type Storage struct {
|
||||
db *sql.DB
|
||||
log *log.Logger
|
||||
}
|
||||
|
||||
func New(path string, log *log.Logger) (*Storage, error) {
|
||||
func New(path string) (*Storage, error) {
|
||||
db, err := sql.Open("sqlite3", path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -19,8 +17,8 @@ func New(path string, log *log.Logger) (*Storage, error) {
|
|||
|
||||
db.SetMaxOpenConns(1)
|
||||
|
||||
if err = migrate(db, log); err != nil {
|
||||
if err = migrate(db); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Storage{db: db, log: log}, nil
|
||||
return &Storage{db: db}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue