Skip to content

Commit

Permalink
dsn: add missing return
Browse files Browse the repository at this point in the history
  • Loading branch information
julienschmidt committed Oct 6, 2017
1 parent a7e960d commit 8d7c8b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dsn.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (cfg *Config) normalize() error {
case "unix":
cfg.Addr = "/tmp/mysql.sock"
default:
errors.New("default addr for network '" + cfg.Net + "' unknown")
return errors.New("default addr for network '" + cfg.Net + "' unknown")
}

} else if cfg.Net == "tcp" {
Expand Down
1 change: 1 addition & 0 deletions dsn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func TestDSNParserInvalid(t *testing.T) {
"(/", // no closing brace
"net(addr)//", // unescaped
"User:pass@tcp(1.2.3.4:3306)", // no trailing slash
"net()/", // unknown default addr
//"/dbname?arg=/some/unescaped/path",
}

Expand Down

0 comments on commit 8d7c8b2

Please sign in to comment.