Linting things.
This commit is contained in:
@@ -169,10 +169,10 @@ func (ff *FlatFiles) Initialize() {
|
||||
ff.path = path
|
||||
c.Logger.Debug().Msgf("Storage path is now: %s", ff.path)
|
||||
|
||||
// Create directory if neccessary.
|
||||
// Create directory if necessary.
|
||||
if _, err := os.Stat(ff.path); err != nil {
|
||||
c.Logger.Debug().Msgf("Directory '%s' does not exist, creating...", ff.path)
|
||||
os.MkdirAll(ff.path, os.ModePerm)
|
||||
_ = os.MkdirAll(ff.path, os.ModePerm)
|
||||
} else {
|
||||
c.Logger.Debug().Msgf("Directory '%s' already exists", ff.path)
|
||||
}
|
||||
@@ -180,7 +180,7 @@ func (ff *FlatFiles) Initialize() {
|
||||
// Create directory for pastes.
|
||||
if _, err := os.Stat(filepath.Join(ff.path, "pastes")); err != nil {
|
||||
c.Logger.Debug().Msgf("Directory '%s' does not exist, creating...", filepath.Join(ff.path, "pastes"))
|
||||
os.MkdirAll(filepath.Join(ff.path, "pastes"), os.ModePerm)
|
||||
_ = os.MkdirAll(filepath.Join(ff.path, "pastes"), os.ModePerm)
|
||||
} else {
|
||||
c.Logger.Debug().Msgf("Directory '%s' already exists", filepath.Join(ff.path, "pastes"))
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ func New(cc *context.Context) {
|
||||
func Migrate() {
|
||||
c.Logger.Info().Msg("Migrating database...")
|
||||
|
||||
goose.SetDialect("mysql")
|
||||
_ = goose.SetDialect("mysql")
|
||||
goose.AddNamedMigration("1_initial.go", InitialUp, nil)
|
||||
goose.AddNamedMigration("2_paste_lang.go", PasteLangUp, PasteLangDown)
|
||||
goose.AddNamedMigration("3_private_pastes.go", PrivatePastesUp, PrivatePastesDown)
|
||||
|
@@ -135,7 +135,7 @@ func (db *Database) Initialize() {
|
||||
|
||||
// There might be only user, without password. MySQL/MariaDB driver
|
||||
// in DSN wants "user" or "user:password", "user:" is invalid.
|
||||
var userpass = ""
|
||||
var userpass string
|
||||
if c.Config.Database.Password == "" {
|
||||
userpass = c.Config.Database.Username
|
||||
} else {
|
||||
|
@@ -46,7 +46,7 @@ func New(cc *context.Context) {
|
||||
func Migrate() {
|
||||
c.Logger.Info().Msg("Migrating database...")
|
||||
|
||||
goose.SetDialect("postgres")
|
||||
_ = goose.SetDialect("postgres")
|
||||
goose.AddNamedMigration("1_initial.go", InitialUp, nil)
|
||||
goose.AddNamedMigration("2_paste_lang.go", PasteLangUp, PasteLangDown)
|
||||
goose.AddNamedMigration("3_private_pastes.go", PrivatePastesUp, PrivatePastesDown)
|
||||
|
@@ -147,7 +147,7 @@ func (db *Database) GetPastesPages() int {
|
||||
func (db *Database) Initialize() {
|
||||
c.Logger.Info().Msg("Initializing database connection...")
|
||||
|
||||
var userpass = ""
|
||||
var userpass string
|
||||
if c.Config.Database.Password == "" {
|
||||
userpass = c.Config.Database.Username
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user