diff --git a/internal/dnsforward/http.go b/internal/dnsforward/http.go index 096c3d73..d0fd0716 100644 --- a/internal/dnsforward/http.go +++ b/internal/dnsforward/http.go @@ -232,13 +232,7 @@ func (req *jsonDNSConfig) checkUpstreamMode() (err error) { } switch um := *req.UpstreamMode; um { - case "": - return nil - case "parallel": - return nil - case "fastest_addr": - return nil - case "load_balance": + case "", "parallel", "fastest_addr", "load_balance": return nil default: return fmt.Errorf("upstream_mode: incorrect value %q", um) @@ -474,9 +468,7 @@ func (s *Server) setConfig(dc *jsonDNSConfig) (shouldRestart bool) { // case of invalid value. func mustParseUpstreamMode(mode string) (um string) { switch mode { - case "": - return UpstreamModeTypeLoadBalance - case "load_balance": + case "", "load_balance": return UpstreamModeTypeLoadBalance case "parallel": return UpstreamModeTypeParallel