mirror of https://github.com/status-im/consul.git
upgrade golangci-lint to v1.40.1 (#10276)
Also: fix linter issue detected with newer version
This commit is contained in:
parent
bb07d1a30f
commit
f2eed912b2
|
@ -126,7 +126,7 @@ jobs:
|
|||
name: Install golangci-lint
|
||||
command: |
|
||||
download=https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh
|
||||
wget -O- -q $download | sh -x -s -- -d -b /go/bin/ v1.23.6
|
||||
wget -O- -q $download | sh -x -s -- -d -b /go/bin/ v1.40.1
|
||||
- run: go mod download
|
||||
- run:
|
||||
name: lint
|
||||
|
|
|
@ -8,7 +8,7 @@ GOTOOLS = \
|
|||
github.com/gogo/protobuf/protoc-gen-gofast@$(GOGOVERSION) \
|
||||
github.com/hashicorp/protoc-gen-go-binary \
|
||||
github.com/vektra/mockery/cmd/mockery \
|
||||
github.com/golangci/golangci-lint/cmd/golangci-lint@v1.23.6
|
||||
github.com/golangci/golangci-lint/cmd/golangci-lint@v1.40.1
|
||||
|
||||
GOTAGS ?=
|
||||
GOOS?=$(shell go env GOOS)
|
||||
|
|
20
agent/dns.go
20
agent/dns.go
|
@ -1429,18 +1429,16 @@ func (d *DNSServer) serviceNodeRecords(cfg *dnsConfig, dc string, nodes structs.
|
|||
}
|
||||
handled[records[0].String()] = struct{}{}
|
||||
|
||||
if records != nil {
|
||||
switch records[0].(type) {
|
||||
case *dns.CNAME:
|
||||
// keep track of the first CNAME + associated RRs but don't add to the resp.Answer yet
|
||||
// this will only be added if no non-CNAME RRs are found
|
||||
if len(answerCNAME) == 0 {
|
||||
answerCNAME = records
|
||||
}
|
||||
default:
|
||||
resp.Answer = append(resp.Answer, records...)
|
||||
had_answer = true
|
||||
switch records[0].(type) {
|
||||
case *dns.CNAME:
|
||||
// keep track of the first CNAME + associated RRs but don't add to the resp.Answer yet
|
||||
// this will only be added if no non-CNAME RRs are found
|
||||
if len(answerCNAME) == 0 {
|
||||
answerCNAME = records
|
||||
}
|
||||
default:
|
||||
resp.Answer = append(resp.Answer, records...)
|
||||
had_answer = true
|
||||
}
|
||||
|
||||
if had_answer {
|
||||
|
|
Loading…
Reference in New Issue