Explorar o código

optimize code (#637)

heyanfu %!s(int64=4) %!d(string=hai) anos
pai
achega
0466af5e49
Modificáronse 1 ficheiros con 3 adicións e 5 borrados
  1. 3 5
      zrpc/config.go

+ 3 - 5
zrpc/config.go

@@ -58,13 +58,11 @@ func (sc RpcServerConf) HasEtcd() bool {
 
 
 // Validate validates the config.
 // Validate validates the config.
 func (sc RpcServerConf) Validate() error {
 func (sc RpcServerConf) Validate() error {
-	if sc.Auth {
-		if err := sc.Redis.Validate(); err != nil {
-			return err
-		}
+	if !sc.Auth {
+		return nil
 	}
 	}
 
 
-	return nil
+	return sc.Redis.Validate()
 }
 }
 
 
 // HasCredential checks if there is a credential in config.
 // HasCredential checks if there is a credential in config.