From 069ee22c6d904db4e983135ce87a9fe8d12b7e9a Mon Sep 17 00:00:00 2001 From: Dimitry Kolyshev Date: Tue, 19 Dec 2023 12:39:25 +0200 Subject: [PATCH] dnsforward: imp code --- internal/dnsforward/http.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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