Browse Source

upgrade golangci-lint to v1.40.1 (#10276)

Also: fix linter issue detected with newer version
pull/10270/head
Dhia Ayachi 4 years ago committed by GitHub
parent
commit
f2eed912b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .circleci/config.yml
  2. 2
      GNUmakefile
  3. 20
      agent/dns.go

2
.circleci/config.yml

@ -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

2
GNUmakefile

@ -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

@ -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…
Cancel
Save