We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbf5c06 commit 19adadaCopy full SHA for 19adada
1 file changed
main.go
@@ -48,14 +48,19 @@ func main() {
48
kingpin.MustParse(app.Parse(os.Args[1:]))
49
50
address := *host
51
+ net := "unix"
52
+ if address != "localhost" {
53
+ net = "tcp"
54
+ }
55
if *port != 0 {
- address += ":" + string(*port)
56
+ address = fmt.Sprintf("%s:%d", address, *port)
57
}
58
59
dsn := Config{
60
User: *user,
61
Passwd: *pass,
62
Addr: address,
63
+ Net: net,
64
DBName: *dbName,
65
ParseTime: true,
66
0 commit comments