Skip to content

Commit 49edc05

Browse files
committed
fix: Proper formating dsn string
1 parent 885cdbc commit 49edc05

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/config/postgres_conn_string_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func TestPostgresConnStringMasked(t *testing.T) {
1111
Password: "real-secret",
1212
}
1313
got := PostgresConnStringMasked(p)
14-
want := "host=db.example.com port=5432 dbname=appdb user=appuser password=" + PasswordMask
14+
want := "host=\"db.example.com\" port=\"5432\" dbname=\"appdb\" user=\"appuser\" password=\"" + PasswordMask + "\""
1515
if got != want {
1616
t.Fatalf("PostgresConnStringMasked() = %q, want %q", got, want)
1717
}
@@ -26,7 +26,7 @@ func TestPostgresConnStringMasked_IPv6Host(t *testing.T) {
2626
Password: "x",
2727
}
2828
got := PostgresConnStringMasked(p)
29-
want := "host=::1 port=5432 dbname=postgres user=u password=" + PasswordMask
29+
want := "host=\"::1\" port=\"5432\" dbname=\"postgres\" user=\"u\" password=\"" + PasswordMask + "\""
3030
if got != want {
3131
t.Fatalf("PostgresConnStringMasked() = %q, want %q", got, want)
3232
}

0 commit comments

Comments
 (0)