Browse Source

apply coding style

Shelikhoo 4 years ago
parent
commit
8323add330
2 changed files with 3 additions and 4 deletions
  1. 2 3
      app/dispatcher/fakednssniffer.go
  2. 1 1
      infra/conf/v2ray.go

+ 2 - 3
app/dispatcher/fakednssniffer.go

@@ -110,10 +110,9 @@ func newFakeDNSThenOthers(ctx context.Context, fakeDNSSniffer protocolSnifferWit
 				}
 				newError("ip address not in fake dns range, return as is").AtDebug().WriteToLog()
 				return nil, common.ErrNoClue
-			} else {
-				newError("fake dns sniffer did not set address in range option, assume false.").AtWarning().WriteToLog()
-				return nil, common.ErrNoClue
 			}
+			newError("fake dns sniffer did not set address in range option, assume false.").AtWarning().WriteToLog()
+			return nil, common.ErrNoClue
 		},
 		metadataSniffer: false,
 	}, nil

+ 1 - 1
infra/conf/v2ray.go

@@ -588,7 +588,7 @@ func (c *Config) Build() (*core.Config, error) {
 			" instead of allowing end user to enable it without special tool and knowledge.")
 		sb := strings.Builder{}
 		return nil, newError("Cannot load service").Base(developererr).Base(err).Base(newError(sb.String()))
-	} else {
+	} else { // nolint: golint
 		// Using a else here is required to keep msg in scope
 		config.App = append(config.App, msg...)
 	}