mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Make sure golint pass on the code base
This commit is contained in:
parent
8781648af9
commit
bb8e61c7c5
59 changed files with 322 additions and 171 deletions
|
@ -8,19 +8,23 @@ import (
|
|||
"database/sql"
|
||||
"log"
|
||||
|
||||
// Postgresql driver import
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
// Storage handles all operations related to the database.
|
||||
type Storage struct {
|
||||
db *sql.DB
|
||||
}
|
||||
|
||||
// Close closes all database connections.
|
||||
func (s *Storage) Close() {
|
||||
s.db.Close()
|
||||
}
|
||||
|
||||
func NewStorage(databaseUrl string, maxOpenConns int) *Storage {
|
||||
db, err := sql.Open("postgres", databaseUrl)
|
||||
// NewStorage returns a new Storage.
|
||||
func NewStorage(databaseURL string, maxOpenConns int) *Storage {
|
||||
db, err := sql.Open("postgres", databaseURL)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to connect to the database: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue