Use golint to normalize the code (#1)

This commit is contained in:
Li4n0
2021-04-21 22:08:29 +08:00
committed by GitHub
parent d4a47aebca
commit 960b2ab5ea
39 changed files with 1046 additions and 1108 deletions
+8 -8
View File
@@ -17,9 +17,9 @@ limitations under the License.
package vmysql
import (
"net"
"net"
querypb "vitess.io/vitess/go/vt/proto/query"
querypb "vitess.io/vitess/go/vt/proto/query"
)
// AuthServerNone takes all comers.
@@ -32,27 +32,27 @@ type AuthServerNone struct{}
// AuthMethod is part of the AuthServer interface.
// We always return MysqlNativePassword.
func (a *AuthServerNone) AuthMethod(user string) (string, error) {
return MysqlNativePassword, nil
return MysqlNativePassword, nil
}
// Salt makes salt
func (a *AuthServerNone) Salt() ([]byte, error) {
return NewSalt()
return NewSalt()
}
// ValidateHash validates hash
func (a *AuthServerNone) ValidateHash(salt []byte, user string, authResponse []byte, remoteAddr net.Addr) (Getter, error) {
return &NoneGetter{}, nil
return &NoneGetter{}, nil
}
// Negotiate is part of the AuthServer interface.
// It will never be called.
func (a *AuthServerNone) Negotiate(c *Conn, user string, remotAddr net.Addr) (Getter, error) {
panic("Negotiate should not be called as AuthMethod returned mysql_native_password")
panic("Negotiate should not be called as AuthMethod returned mysql_native_password")
}
func init() {
RegisterAuthServerImpl("none", &AuthServerNone{})
RegisterAuthServerImpl("none", &AuthServerNone{})
}
// NoneGetter holds the empty string
@@ -60,5 +60,5 @@ type NoneGetter struct{}
// Get returns the empty string
func (ng *NoneGetter) Get() *querypb.VTGateCallerID {
return &querypb.VTGateCallerID{Username: "userData1"}
return &querypb.VTGateCallerID{Username: "userData1"}
}