Skip to content

Commit

Permalink
Add error handling for Setenv
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mizutani committed Aug 27, 2023
1 parent f4603b5 commit 9f358ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controller/cli/migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ func New() *cli.Command {
Host: dbConfig.Host,
Port: dbConfig.Port,
}
os.Setenv("PGSSLMODE", dbConfig.SSLMode)
if err := os.Setenv("PGSSLMODE", dbConfig.SSLMode); err != nil {
return goerr.Wrap(err, "failed to set PGSSLMODE")
}

db, err := postgres.NewDatabase(config)
if err != nil {
Expand Down

0 comments on commit 9f358ab

Please sign in to comment.