diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dcfe461..4584bd27 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: @@ -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 }} 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 } }