Review fixes

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-07 11:52:00 +04:00
parent 9e21f8fb08
commit 72fa79629f
12 changed files with 71 additions and 12 deletions

View File

@@ -21,6 +21,7 @@ import (
"encoding/json"
"flag"
"fmt"
"net"
"net/url"
"os"
"time"
@@ -130,7 +131,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) {
var opts []pg.Option
if u.Host != "" {
opts = append(opts, pg.WithAddr(u.Host))
host := u.Host
if u.Port() == "" {
host = net.JoinHostPort(u.Hostname(), "5432")
}
opts = append(opts, pg.WithAddr(host))
}
if u.User != nil {