Skip to content

Commit

Permalink
ref: fix namespace shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
crazybolillo committed Aug 6, 2024
1 parent 57793bb commit 7708f59
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ func serve(ctx context.Context) error {
return fmt.Errorf("missing Database URL")
}

url, err := url.Parse(dbUrl)
u, err := url.Parse(dbUrl)
if err != nil {
slog.Error("Invalid database URL", "reason", err.Error())
return err
}
slog.Info(
"Connecting to database",
slog.String("host", url.Host),
slog.String("port", url.Port()),
slog.String("user", url.User.Username()),
slog.String("database", url.Path[1:]),
slog.String("host", u.Host),
slog.String("port", u.Port()),
slog.String("user", u.User.Username()),
slog.String("database", u.Path[1:]),
)

conn, err := pgx.Connect(ctx, os.Getenv("DATABASE_URL"))
Expand Down

0 comments on commit 7708f59

Please sign in to comment.