lint: don't capitalize error messages

This commit is contained in:
Eli Ribble 2026-05-19 15:24:44 +00:00
parent 8ac613000b
commit 12e9599c15
No known key found for this signature in database

View file

@ -142,7 +142,7 @@ func doMigrations(connection_string string) error {
log.Debug().Str("dsn", connection_string).Msg("Connecting to database")
db, err := sql.Open("pgx", connection_string)
if err != nil {
return fmt.Errorf("Failed to open database connection: %w", err)
return fmt.Errorf("failed to open database connection: %w", err)
}
defer func() {
err := db.Close()
@ -153,28 +153,28 @@ func doMigrations(connection_string string) error {
row := db.QueryRowContext(context.Background(), "SELECT version()")
var val string
if err := row.Scan(&val); err != nil {
return fmt.Errorf("Failed to get database version query result: %w", err)
return fmt.Errorf("failed to get database version query result: %w", err)
}
log.Info().Str("version", val).Msg("Connected to database")
fsys, err := fs.Sub(embedMigrations, "migrations")
if err != nil {
return fmt.Errorf("Failed to get migrations embedded directory: %w", err)
return fmt.Errorf("failed to get migrations embedded directory: %w", err)
}
provider, err := goose.NewProvider(goose.DialectPostgres, db, fsys)
if err != nil {
return fmt.Errorf("Failed to create goose provider: %w", err)
return fmt.Errorf("failed to create goose provider: %w", err)
}
//goose.SetBaseFS(embedMigrations)
current, target, err := provider.GetVersions(context.Background())
if err != nil {
return fmt.Errorf("Faield to get goose versions: %w", err)
return fmt.Errorf("faield to get goose versions: %w", err)
}
log.Info().Int("current", int(current)).Int("target", int(target)).Msg("Migration status")
results, err := provider.Up(context.Background())
if err != nil {
return fmt.Errorf("Failed to run migrations: %w", err)
return fmt.Errorf("failed to run migrations: %w", err)
}
if len(results) > 0 {
for _, r := range results {