소스 검색

optimize code (#637)

heyanfu 4 년 전
부모
커밋
0466af5e49
1개의 변경된 파일3개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 5
      zrpc/config.go

+ 3 - 5
zrpc/config.go

@@ -58,13 +58,11 @@ func (sc RpcServerConf) HasEtcd() bool {
 
 // Validate validates the config.
 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.