internal/postgres: add GO_DISCOVERY_DATABASE_TEST_PORT
Fixes b/139522219.
@@ -40,9 +40,10 @@ func dbConnURI(dbName string) string {
user = getEnv("GO_DISCOVERY_DATABASE_TEST_USER", "postgres")
password = getEnv("GO_DISCOVERY_DATABASE_TEST_PASSWORD", "")
host = getEnv("GO_DISCOVERY_DATABASE_TEST_HOST", "localhost")
+ port = getEnv("GO_DISCOVERY_DATABASE_TEST_PORT", "5432")
)
- cs := fmt.Sprintf("postgres://%s/%s?sslmode=disable&user=%s&password=%s",
- host, dbName, url.QueryEscape(user), url.QueryEscape(password))
+ cs := fmt.Sprintf("postgres://%s/%s?sslmode=disable&user=%s&password=%s&port=%s",
+ host, dbName, url.QueryEscape(user), url.QueryEscape(password), url.QueryEscape(port))
return cs
}
