mirror of
https://github.com/coredns/coredns.git
synced 2025-10-26 15:54:16 -04:00
chore(lint): bump to v2.5.0 and enable godoclint (#7632)
This commit is contained in:
2
.github/workflows/golangci-lint.yml
vendored
2
.github/workflows/golangci-lint.yml
vendored
@@ -20,6 +20,6 @@ jobs:
|
|||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
|
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
|
||||||
with:
|
with:
|
||||||
version: v2.4.0
|
version: v2.5.0
|
||||||
- name: modernize
|
- name: modernize
|
||||||
run: go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@2e31135b736b96cd609904370c71563ce5447826 -diff -test ./... # v0.20.0
|
run: go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@2e31135b736b96cd609904370c71563ce5447826 -diff -test ./... # v0.20.0
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ linters:
|
|||||||
- canonicalheader
|
- canonicalheader
|
||||||
- copyloopvar
|
- copyloopvar
|
||||||
- durationcheck
|
- durationcheck
|
||||||
|
- godoclint
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- intrange
|
- intrange
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ func AddPrefix(b []byte) (m []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// These methods implement the dns.ResponseWriter interface from Go DNS.
|
// These methods implement the dns.ResponseWriter interface from Go DNS.
|
||||||
|
|
||||||
func (w *DoQWriter) TsigStatus() error { return nil }
|
func (w *DoQWriter) TsigStatus() error { return nil }
|
||||||
func (w *DoQWriter) TsigTimersOnly(b bool) {}
|
func (w *DoQWriter) TsigTimersOnly(b bool) {}
|
||||||
func (w *DoQWriter) Hijack() {}
|
func (w *DoQWriter) Hijack() {}
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ func (r *gRPCresponse) Write(b []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// These methods implement the dns.ResponseWriter interface from Go DNS.
|
// These methods implement the dns.ResponseWriter interface from Go DNS.
|
||||||
|
|
||||||
func (r *gRPCresponse) Close() error { return nil }
|
func (r *gRPCresponse) Close() error { return nil }
|
||||||
func (r *gRPCresponse) TsigStatus() error { return nil }
|
func (r *gRPCresponse) TsigStatus() error { return nil }
|
||||||
func (r *gRPCresponse) TsigTimersOnly(b bool) {}
|
func (r *gRPCresponse) TsigTimersOnly(b bool) {}
|
||||||
|
|||||||
@@ -192,6 +192,6 @@ var (
|
|||||||
gitShortStat string // git diff-index --shortstat
|
gitShortStat string // git diff-index --shortstat
|
||||||
gitFilesModified string // git diff-index --name-only HEAD
|
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
|
GitCommit string
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Package auto implements a on-the-fly loading file backend.
|
|
||||||
package auto
|
package auto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
mcs "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1"
|
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 {
|
type MultiClusterEndpoints struct {
|
||||||
Endpoints
|
Endpoints
|
||||||
ClusterId string
|
ClusterId string
|
||||||
@@ -18,7 +18,7 @@ type MultiClusterEndpoints struct {
|
|||||||
// MultiClusterEndpointsKey returns a string using for the index.
|
// MultiClusterEndpointsKey returns a string using for the index.
|
||||||
func MultiClusterEndpointsKey(name, namespace string) string { return name + "." + namespace }
|
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) {
|
func EndpointSliceToMultiClusterEndpoints(obj meta.Object) (meta.Object, error) {
|
||||||
labels := maps.Clone(obj.GetLabels())
|
labels := maps.Clone(obj.GetLabels())
|
||||||
ends, err := EndpointSliceToEndpoints(obj)
|
ends, err := EndpointSliceToEndpoints(obj)
|
||||||
|
|||||||
@@ -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
|
package loadbalance
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/miekg/dns"
|
"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 {
|
type LoadBalance struct {
|
||||||
Next plugin.Handler
|
Next plugin.Handler
|
||||||
shuffle func(*dns.Msg) *dns.Msg
|
shuffle func(*dns.Msg) *dns.Msg
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Package loadbalance shuffles A, AAAA and MX records.
|
|
||||||
package loadbalance
|
package loadbalance
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Package rewrite is a plugin for rewriting requests internally to something different.
|
|
||||||
package rewrite
|
package rewrite
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ const (
|
|||||||
|
|
||||||
// These are defined processing mode.
|
// These are defined processing mode.
|
||||||
const (
|
const (
|
||||||
// Processing should stop after completing this rule
|
// Stop processing should stop after completing this rule
|
||||||
Stop = "stop"
|
Stop = "stop"
|
||||||
// Processing should continue to next rule
|
// Continue processing should continue to next rule
|
||||||
Continue = "continue"
|
Continue = "continue"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Package rewrite is a plugin for rewriting requests internally to something different.
|
|
||||||
package rewrite
|
package rewrite
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
// Package test contains helper functions for writing plugin tests.
|
|
||||||
package test
|
|
||||||
@@ -14,7 +14,8 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// 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:
|
// Basic usage:
|
||||||
//
|
//
|
||||||
// result := Scrape("http://localhost:9153/metrics")
|
// result := Scrape("http://localhost:9153/metrics")
|
||||||
|
|||||||
Reference in New Issue
Block a user