Skip to content

Commit 0da459f

Browse files
committed
gofmt changes only
I consider Go 100% wrong in not indenting switch/case.
1 parent 2757a06 commit 0da459f

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

client/tls.go

-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ func NewClientTLSConfig(caPem, certPem, keyPem []byte, insecureSkipVerify bool,
3838

3939
return config
4040
}
41-

driver/driver.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ func (d driver) Open(dsn string) (sqldriver.Conn, error) {
7676
tlsConfigName, tls := params["ssl"]
7777
if tls {
7878
switch tlsConfigName {
79-
case "true":
80-
// This actually does insecureSkipVerify
81-
// But not even sure if it makes sense to handle false? According to
82-
// client_test.go it doesn't - it'd result in an error
83-
c, err = client.Connect(addr, user, password, db, func(c *client.Conn) { c.UseSSL(true) })
84-
case "custom":
85-
// I was too concerned about mimicking what go-sql-driver/mysql does which will
86-
// allow any name for a custom tls profile and maps the query parameter value to
87-
// that TLSConfig variable... there is no need to be that clever. We can just
88-
// insist `"custom"` (string) == `custom` (TLSConfig)
89-
c, err = client.Connect(addr, user, password, db, func(c *client.Conn) {c.SetTLSConfig(customTLSConfig)})
90-
default:
91-
return nil, errors.Errorf("Supported options are ssl=true or ssl=custom")
79+
case "true":
80+
// This actually does insecureSkipVerify
81+
// But not even sure if it makes sense to handle false? According to
82+
// client_test.go it doesn't - it'd result in an error
83+
c, err = client.Connect(addr, user, password, db, func(c *client.Conn) { c.UseSSL(true) })
84+
case "custom":
85+
// I was too concerned about mimicking what go-sql-driver/mysql does which will
86+
// allow any name for a custom tls profile and maps the query parameter value to
87+
// that TLSConfig variable... there is no need to be that clever. We can just
88+
// insist `"custom"` (string) == `custom` (TLSConfig)
89+
c, err = client.Connect(addr, user, password, db, func(c *client.Conn) { c.SetTLSConfig(customTLSConfig) })
90+
default:
91+
return nil, errors.Errorf("Supported options are ssl=true or ssl=custom")
9292
}
9393
} else {
9494
c, err = client.Connect(addr, user, password, db)

0 commit comments

Comments
 (0)