From de8711536dde1e78904c13d1eefb48835f3717d1 Mon Sep 17 00:00:00 2001 From: Jose' Pedro Saraiva Date: Tue, 10 Jun 2025 10:54:06 +0200 Subject: [PATCH 1/3] ci: bump golangci-lint to 2.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dcfe461..4595d1ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: strategy: matrix: go: ["1.24"] - lint: ["v1.64.8"] + lint: ["v2.1"] name: lint runs-on: ubuntu-latest steps: From 32c798c5ddf229713db07a8d87a45db0f22b36b5 Mon Sep 17 00:00:00 2001 From: Jose' Pedro Saraiva Date: Tue, 10 Jun 2025 10:54:49 +0200 Subject: [PATCH 2/3] bump golangci/golangci-lint-action to v8 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4595d1ab..4584bd27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,6 +53,6 @@ jobs: go-version: ${{ matrix.go }} cache: true - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v8 with: version: ${{ matrix.lint }} From 1634d15cccaba90de5b74a704c932c7f7b27d11a Mon Sep 17 00:00:00 2001 From: Jose' Pedro Saraiva Date: Tue, 10 Jun 2025 10:59:25 +0200 Subject: [PATCH 3/3] Fix or disable newly detected issues --- consul/consul.go | 4 ++-- etcd/etcd.go | 2 +- registrator.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/consul/consul.go b/consul/consul.go index 0bc9c8b0..d053f064 100644 --- a/consul/consul.go +++ b/consul/consul.go @@ -23,8 +23,8 @@ func init() { } func (r *ConsulAdapter) interpolateService(script string, service *bridge.Service) string { - withIp := strings.Replace(script, "$SERVICE_IP", service.IP, -1) - withPort := strings.Replace(withIp, "$SERVICE_PORT", strconv.Itoa(service.Port), -1) + withIp := strings.ReplaceAll(script, "$SERVICE_IP", service.IP) + withPort := strings.ReplaceAll(withIp, "$SERVICE_PORT", strconv.Itoa(service.Port)) return withPort } diff --git a/etcd/etcd.go b/etcd/etcd.go index 218e77af..a576b254 100644 --- a/etcd/etcd.go +++ b/etcd/etcd.go @@ -33,7 +33,7 @@ func (f *Factory) New(uri *url.URL) bridge.RegistryAdapter { log.Fatal("etcd: error retrieving version", err) } - defer res.Body.Close() + defer res.Body.Close() //nolint: errcheck body, _ := io.ReadAll(res.Body) if match, _ := regexp.Match("0\\.4\\.*", body); match { diff --git a/registrator.go b/registrator.go index b547ca57..209448e9 100644 --- a/registrator.go +++ b/registrator.go @@ -86,9 +86,9 @@ func main() { dockerHost := os.Getenv("DOCKER_HOST") if dockerHost == "" { if runtime.GOOS != "windows" { - os.Setenv("DOCKER_HOST", "unix:///tmp/docker.sock") + os.Setenv("DOCKER_HOST", "unix:///tmp/docker.sock") //nolint: errcheck } else { - os.Setenv("DOCKER_HOST", "npipe:////./pipe/docker_engine") + os.Setenv("DOCKER_HOST", "npipe:////./pipe/docker_engine") //nolint: errcheck } }