Capitalize error messages according to staticcheck
This commit is contained in:
parent
e3b69e8f83
commit
30f5497aa5
7 changed files with 48 additions and 48 deletions
|
@ -21,7 +21,7 @@ func Connect(config config.Config) (*sql.DB, error) {
|
|||
config.SQL.MysqlPort,
|
||||
config.SQL.MysqlDatabase)
|
||||
default:
|
||||
return nil, fmt.Errorf("Type of database not recognised: %s", config.SQL.Type)
|
||||
return nil, fmt.Errorf("type of database not recognised: %s", config.SQL.Type)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ func Connect(config config.Config) (*sql.DB, error) {
|
|||
func connectSQLite(file string) (*sql.DB, error) {
|
||||
db, err := sql.Open("sqlite3", file)
|
||||
if err != nil {
|
||||
return db, fmt.Errorf("Error opening SQLite database: %w", err)
|
||||
return db, fmt.Errorf("error opening SQLite database: %w", err)
|
||||
}
|
||||
return db, nil
|
||||
}
|
||||
|
@ -38,12 +38,12 @@ func connectSQLite(file string) (*sql.DB, error) {
|
|||
func connectMysql(user string, password string, address string, port int, database string) (*sql.DB, error) {
|
||||
db, err := sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s:%d)/%s", user, password, address, port, database))
|
||||
if err != nil {
|
||||
return db, fmt.Errorf("Error connecting to Mysql database: %w", err)
|
||||
return db, fmt.Errorf("error connecting to Mysql database: %w", err)
|
||||
}
|
||||
|
||||
err = db.Ping()
|
||||
if err != nil {
|
||||
return db, fmt.Errorf("Error pinging Mysql database: %w", err)
|
||||
return db, fmt.Errorf("error pinging Mysql database: %w", err)
|
||||
}
|
||||
return db, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue