From 24a62d063819c0c30ec3502949bcca290b09162d Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Thu, 9 Nov 2023 13:02:05 +0300 Subject: [PATCH] all: imp script, code --- internal/dnsforward/http.go | 17 +++++++++-------- scripts/make/go-lint.sh | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/internal/dnsforward/http.go b/internal/dnsforward/http.go index 9b7eaea2..022cad99 100644 --- a/internal/dnsforward/http.go +++ b/internal/dnsforward/http.go @@ -626,7 +626,8 @@ func separateUpstream(upstreamStr string) (upstreams, domains []string, err erro // properly. type healthCheckFunc func(u upstream.Upstream) (err error) -// checkExchange checks if the DNS upstream exchanges correctly. +// checkExchange is a [healthCheckFunc] that checks if the DNS upstream +// exchanges correctly. func checkExchange(u upstream.Upstream) (err error) { // testTLD is the special-use fully-qualified domain name for testing the // DNS server reachability. @@ -657,8 +658,8 @@ func checkExchange(u upstream.Upstream) (err error) { return nil } -// checkPrivateExchange checks if the upstream for resolving private addresses -// exchanges correctly. +// checkPrivateExchange is a [healthCheckFunc] that checks if the upstream for +// resolving private addresses exchanges correctly. // // TODO(e.burkov): Think about testing the ip6.arpa. as well. func checkPrivateExchange(u upstream.Upstream) (err error) { @@ -702,9 +703,9 @@ func (err domainSpecificTestError) Error() (msg string) { return fmt.Sprintf("WARNING: %s", err.error) } -// checkUpstreamAddr creates the DNS upstream using opts and information from -// system hosts files. Checks if the DNS upstream exchanges correctly. It -// returns an error if addr is not valid DNS upstream address or the upstream +// checkUpstreamAddr creates the upstream using opts and, possibly, information +// from system hosts files, then checks if the DNS upstream exchanges correctly. +// It returns an error if addr is not valid DNS upstream address or the upstream // is not exchanging correctly. // // TODO(e.burkov): Remove the receiver. @@ -767,8 +768,8 @@ type checkResult = struct { } // checkDNS parses an upstream configuration line using opts and checks if the -// specified upstreams are working using check. addWG is decremented when the -// expected number of results is added to resWG, then results are sent to resCh. +// specified upstreams are working using check. countWG is decremented when the +// expected number of results added to resNum, then results are sent to resCh. // // TODO(e.burkov): Remove the receiver. func (s *Server) checkDNS( diff --git a/scripts/make/go-lint.sh b/scripts/make/go-lint.sh index 737f8dc4..1ba1e9d9 100644 --- a/scripts/make/go-lint.sh +++ b/scripts/make/go-lint.sh @@ -35,7 +35,7 @@ set -f -u go_version="$( "${GO:-go}" version )" readonly go_version -go_min_version='go1.20.10' +go_min_version='go1.20.11' go_version_msg=" warning: your go version (${go_version}) is different from the recommended minimal one (${go_min_version}). if you have the version installed, please set the GO environment variable.