From d9378e3513068288bd10914e93fe3ac2499b1ec2 Mon Sep 17 00:00:00 2001 From: Mateusz Gozdek Date: Mon, 9 May 2022 13:47:35 +0200 Subject: [PATCH] Update golangci-lint to latest version v1.46.0 Signed-off-by: Mateusz Gozdek --- .github/workflows/ci.yml | 2 +- .golangci.yml | 4 ++++ Makefile | 2 +- e2e/main_test.go | 2 +- pkg/etcd/member.go | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd36e5df..a3b38598 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: jobs: build: runs-on: ubuntu-latest - container: golangci/golangci-lint:v1.45.1 + container: golangci/golangci-lint:v1.46.0 steps: - uses: actions/cache@v2 with: diff --git a/.golangci.yml b/.golangci.yml index 59712868..15d701c2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -76,6 +76,7 @@ linters: - goerr113 # To be able to make use of Go zero-value feature. - exhaustivestruct + - exhaustruct # To allow defensive approach when initializing structs. - ireturn # This linter has been deprecated. @@ -99,6 +100,7 @@ linters: - errchkjson - errname - errorlint + - execinquery - exhaustive - exportloopref - forbidigo @@ -135,6 +137,8 @@ linters: - nlreturn - noctx - nolintlint + - nonamedreturns + - nosprintfhostport - paralleltest - prealloc - predeclared diff --git a/Makefile b/Makefile index 4e4f7022..ec919665 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ GORUN=$(GOCMD) run GOBUILD=$(GOCMD) build -v -ldflags $(LD_FLAGS) -trimpath CC_TEST_REPORTER_ID=6e107e510c5479f40b0ce9166a254f3f1ee0bc547b3e48281bada1a5a32bb56d -GOLANGCI_LINT_VERSION=v1.45.1 +GOLANGCI_LINT_VERSION=v1.46.0 BIN_PATH=$$HOME/bin GO_PACKAGES=./... diff --git a/e2e/main_test.go b/e2e/main_test.go index d2d9c64e..23f2ee93 100644 --- a/e2e/main_test.go +++ b/e2e/main_test.go @@ -223,7 +223,7 @@ func TestE2e(t *testing.T) { Host: host, }) - etcdServers = append(etcdServers, fmt.Sprintf("https://%s:2379", controllerIP)) + etcdServers = append(etcdServers, fmt.Sprintf("https://%s", net.JoinHostPort(controllerIP, "2379"))) controllerKubelets = append(controllerKubelets, kubelet.Kubelet{ Name: name, diff --git a/pkg/etcd/member.go b/pkg/etcd/member.go index b9828ee7..ae8398af 100644 --- a/pkg/etcd/member.go +++ b/pkg/etcd/member.go @@ -6,6 +6,7 @@ import ( "crypto/x509" "encoding/pem" "fmt" + "net" "strings" clientv3 "go.etcd.io/etcd/client/v3" @@ -317,7 +318,7 @@ func (m *MemberConfig) Validate() error { // peerURLs returns slice of peer urls assigned to member. func (m *member) peerURLs() []string { - return []string{fmt.Sprintf("https://%s:2380", m.config.PeerAddress)} + return []string{fmt.Sprintf("https://%s", net.JoinHostPort(m.config.PeerAddress, "2380"))} } // forwardEndpoints opens forwarding connection for each endpoint