File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -124,15 +124,15 @@ func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
124
124
return mc , nil
125
125
}
126
126
127
- func handleAuthResult (mc * mysqlConn , cipher []byte ) ( err error ) {
127
+ func handleAuthResult (mc * mysqlConn , cipher []byte ) error {
128
128
// Read Result Packet
129
- err = mc .readResultOK ()
129
+ err : = mc .readResultOK ()
130
130
if err == nil {
131
- return // auth successful
131
+ return nil // auth successful
132
132
}
133
133
134
134
if mc .cfg == nil {
135
- return // auth failed and retry not possible
135
+ return err // auth failed and retry not possible
136
136
}
137
137
138
138
// Retry auth if configured to do so.
@@ -141,19 +141,19 @@ func handleAuthResult(mc *mysqlConn, cipher []byte) (err error) {
141
141
// where this should work but doesn't; this is currently "wontfix":
142
142
// https://github.com/go-sql-driver/mysql/issues/184
143
143
if err = mc .writeOldAuthPacket (cipher ); err != nil {
144
- return
144
+ return err
145
145
}
146
146
err = mc .readResultOK ()
147
147
} else if mc .cfg .allowCleartextPasswords && err == ErrCleartextPassword {
148
148
// Retry with clear text password for
149
149
// http://dev.mysql.com/doc/refman/5.7/en/cleartext-authentication-plugin.html
150
150
// http://dev.mysql.com/doc/refman/5.7/en/pam-authentication-plugin.html
151
151
if err = mc .writeClearAuthPacket (); err != nil {
152
- return
152
+ return err
153
153
}
154
154
err = mc .readResultOK ()
155
155
}
156
- return
156
+ return err
157
157
}
158
158
159
159
func init () {
You can’t perform that action at this time.
0 commit comments