Skip to content

Commit 3bdaabf

Browse files
authored
Merge pull request #306 from invidian/update-linter
Update golangci-lint to latest version v1.46.0
2 parents 323c462 + d9378e3 commit 3bdaabf

5 files changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10-
container: golangci/golangci-lint:v1.45.1
10+
container: golangci/golangci-lint:v1.46.0
1111
steps:
1212
- uses: actions/cache@v2
1313
with:

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ linters:
7676
- goerr113
7777
# To be able to make use of Go zero-value feature.
7878
- exhaustivestruct
79+
- exhaustruct
7980
# To allow defensive approach when initializing structs.
8081
- ireturn
8182
# This linter has been deprecated.
@@ -99,6 +100,7 @@ linters:
99100
- errchkjson
100101
- errname
101102
- errorlint
103+
- execinquery
102104
- exhaustive
103105
- exportloopref
104106
- forbidigo
@@ -135,6 +137,8 @@ linters:
135137
- nlreturn
136138
- noctx
137139
- nolintlint
140+
- nonamedreturns
141+
- nosprintfhostport
138142
- paralleltest
139143
- prealloc
140144
- predeclared

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GORUN=$(GOCMD) run
1111
GOBUILD=$(GOCMD) build -v -ldflags $(LD_FLAGS) -trimpath
1212

1313
CC_TEST_REPORTER_ID=6e107e510c5479f40b0ce9166a254f3f1ee0bc547b3e48281bada1a5a32bb56d
14-
GOLANGCI_LINT_VERSION=v1.45.1
14+
GOLANGCI_LINT_VERSION=v1.46.0
1515
BIN_PATH=$$HOME/bin
1616

1717
GO_PACKAGES=./...

e2e/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func TestE2e(t *testing.T) {
223223
Host: host,
224224
})
225225

226-
etcdServers = append(etcdServers, fmt.Sprintf("https://%s:2379", controllerIP))
226+
etcdServers = append(etcdServers, fmt.Sprintf("https://%s", net.JoinHostPort(controllerIP, "2379")))
227227

228228
controllerKubelets = append(controllerKubelets, kubelet.Kubelet{
229229
Name: name,

pkg/etcd/member.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"crypto/x509"
77
"encoding/pem"
88
"fmt"
9+
"net"
910
"strings"
1011

1112
clientv3 "go.etcd.io/etcd/client/v3"
@@ -317,7 +318,7 @@ func (m *MemberConfig) Validate() error {
317318

318319
// peerURLs returns slice of peer urls assigned to member.
319320
func (m *member) peerURLs() []string {
320-
return []string{fmt.Sprintf("https://%s:2380", m.config.PeerAddress)}
321+
return []string{fmt.Sprintf("https://%s", net.JoinHostPort(m.config.PeerAddress, "2380"))}
321322
}
322323

323324
// forwardEndpoints opens forwarding connection for each endpoint

0 commit comments

Comments
 (0)