diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 5186cc2b7..0ff81868f 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -20,6 +20,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 with: - version: v2.4.0 + version: v2.5.0 - name: modernize run: go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@2e31135b736b96cd609904370c71563ce5447826 -diff -test ./... # v0.20.0 diff --git a/.golangci.yml b/.golangci.yml index 26b005c16..3dba51c3c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -10,6 +10,7 @@ linters: - canonicalheader - copyloopvar - durationcheck + - godoclint - govet - ineffassign - intrange diff --git a/core/dnsserver/quic.go b/core/dnsserver/quic.go index f7cde74a8..24684a45b 100644 --- a/core/dnsserver/quic.go +++ b/core/dnsserver/quic.go @@ -60,6 +60,7 @@ func AddPrefix(b []byte) (m []byte) { } // These methods implement the dns.ResponseWriter interface from Go DNS. + func (w *DoQWriter) TsigStatus() error { return nil } func (w *DoQWriter) TsigTimersOnly(b bool) {} func (w *DoQWriter) Hijack() {} diff --git a/core/dnsserver/server_grpc.go b/core/dnsserver/server_grpc.go index 3a4da752d..a834502c8 100644 --- a/core/dnsserver/server_grpc.go +++ b/core/dnsserver/server_grpc.go @@ -175,6 +175,7 @@ func (r *gRPCresponse) Write(b []byte) (int, error) { } // These methods implement the dns.ResponseWriter interface from Go DNS. + func (r *gRPCresponse) Close() error { return nil } func (r *gRPCresponse) TsigStatus() error { return nil } func (r *gRPCresponse) TsigTimersOnly(b bool) {} diff --git a/coremain/run.go b/coremain/run.go index 41e91b050..ce30770ec 100644 --- a/coremain/run.go +++ b/coremain/run.go @@ -192,6 +192,6 @@ var ( gitShortStat string // git diff-index --shortstat gitFilesModified string // git diff-index --name-only HEAD - // Gitcommit contains the commit where we built CoreDNS from. + // GitCommit contains the commit where we built CoreDNS from. GitCommit string ) diff --git a/plugin/auto/zone.go b/plugin/auto/zone.go index bb8118613..e10fee98b 100644 --- a/plugin/auto/zone.go +++ b/plugin/auto/zone.go @@ -1,4 +1,3 @@ -// Package auto implements a on-the-fly loading file backend. package auto import ( diff --git a/plugin/kubernetes/object/multicluster_endpoint.go b/plugin/kubernetes/object/multicluster_endpoint.go index c4a3d6d56..d03d2b2f1 100644 --- a/plugin/kubernetes/object/multicluster_endpoint.go +++ b/plugin/kubernetes/object/multicluster_endpoint.go @@ -8,7 +8,7 @@ import ( mcs "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" ) -// Endpoints is a stripped down api.Endpoints with only the items we need for CoreDNS. +// MultiClusterEndpoints is a stripped down api.Endpoints with only the items we need for CoreDNS. type MultiClusterEndpoints struct { Endpoints ClusterId string @@ -18,7 +18,7 @@ type MultiClusterEndpoints struct { // MultiClusterEndpointsKey returns a string using for the index. func MultiClusterEndpointsKey(name, namespace string) string { return name + "." + namespace } -// EndpointSliceToEndpoints converts a *discovery.EndpointSlice to a *Endpoints. +// EndpointSliceToMultiClusterEndpoints converts a *discovery.EndpointSlice to a *Endpoints. func EndpointSliceToMultiClusterEndpoints(obj meta.Object) (meta.Object, error) { labels := maps.Clone(obj.GetLabels()) ends, err := EndpointSliceToEndpoints(obj) diff --git a/plugin/loadbalance/handler.go b/plugin/loadbalance/handler.go index 8b84e1c5c..83ad8d61f 100644 --- a/plugin/loadbalance/handler.go +++ b/plugin/loadbalance/handler.go @@ -1,4 +1,4 @@ -// Package loadbalance is a plugin for rewriting responses to do "load balancing" +// Package loadbalance is a plugin for rewriting responses to do "load balancing". package loadbalance import ( @@ -9,7 +9,7 @@ import ( "github.com/miekg/dns" ) -// RoundRobin is a plugin to rewrite responses for "load balancing". +// LoadBalance is a plugin to rewrite responses for "load balancing". type LoadBalance struct { Next plugin.Handler shuffle func(*dns.Msg) *dns.Msg diff --git a/plugin/loadbalance/loadbalance.go b/plugin/loadbalance/loadbalance.go index 88f2da031..6d014d2ae 100644 --- a/plugin/loadbalance/loadbalance.go +++ b/plugin/loadbalance/loadbalance.go @@ -1,4 +1,3 @@ -// Package loadbalance shuffles A, AAAA and MX records. package loadbalance import ( diff --git a/plugin/rewrite/edns0.go b/plugin/rewrite/edns0.go index f4155fd4b..4ff4ff0f2 100644 --- a/plugin/rewrite/edns0.go +++ b/plugin/rewrite/edns0.go @@ -1,4 +1,3 @@ -// Package rewrite is a plugin for rewriting requests internally to something different. package rewrite import ( diff --git a/plugin/rewrite/rewrite.go b/plugin/rewrite/rewrite.go index 76b60c864..5320c5b5d 100644 --- a/plugin/rewrite/rewrite.go +++ b/plugin/rewrite/rewrite.go @@ -23,9 +23,9 @@ const ( // These are defined processing mode. const ( - // Processing should stop after completing this rule + // Stop processing should stop after completing this rule Stop = "stop" - // Processing should continue to next rule + // Continue processing should continue to next rule Continue = "continue" ) diff --git a/plugin/rewrite/type.go b/plugin/rewrite/type.go index 63796e9dc..09fe5e680 100644 --- a/plugin/rewrite/type.go +++ b/plugin/rewrite/type.go @@ -1,4 +1,3 @@ -// Package rewrite is a plugin for rewriting requests internally to something different. package rewrite import ( diff --git a/plugin/test/doc.go b/plugin/test/doc.go deleted file mode 100644 index 75281ed8b..000000000 --- a/plugin/test/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package test contains helper functions for writing plugin tests. -package test diff --git a/plugin/test/scrape.go b/plugin/test/scrape.go index df8450f19..be5b12425 100644 --- a/plugin/test/scrape.go +++ b/plugin/test/scrape.go @@ -14,7 +14,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package test will scrape a target and you can inspect the variables. +// Package test contains helper functions for writing plugin tests. +// For example to scrape a target and inspect the variables. // Basic usage: // // result := Scrape("http://localhost:9153/metrics")