diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 106647c9c..382da9be0 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -10,7 +10,7 @@ on: - "docs/**" env: - GO_VERSION: 1.24.x + GO_VERSION: 1.26.x WIX_VERSION: 5.0.0 PYTHON_VERSION: 3.7.9 @@ -232,7 +232,7 @@ jobs: run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VER env: - GOLANGCI_LINT_VER: v2.2.2 + GOLANGCI_LINT_VER: v2.9.0 - name: Lint shell: bash run: | diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 364111125..5931ba188 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,7 +8,7 @@ on: - "docs/**" env: - GO_VERSION: 1.24.x + GO_VERSION: 1.26.x WIX_VERSION: 5.0.0 PYTHON_VERSION: 3.7.9 @@ -214,7 +214,7 @@ jobs: run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VER env: - GOLANGCI_LINT_VER: v2.2.2 + GOLANGCI_LINT_VER: v2.9.0 - name: Lint shell: bash run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 606e59141..898658b70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - 'v*' env: - GO_VERSION: 1.24.x + GO_VERSION: 1.26.x WIX_VERSION: 5.0.0 PYTHON_VERSION: 3.7.9 diff --git a/.golangci.yml b/.golangci.yml index 07e469cd0..92a33a603 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -34,6 +34,7 @@ linters: - errcheck - nolintlint - staticcheck + - noctx path: _test\.go paths: - third_party$ diff --git a/go.mod b/go.mod index 99cd017b4..6496dfa76 100644 --- a/go.mod +++ b/go.mod @@ -94,4 +94,4 @@ require ( gopkg.in/yaml.v2 v2.3.0 // indirect ) -go 1.24.5 +go 1.26.0 diff --git a/pkg/api/listener.go b/pkg/api/listener.go index af63e5e4e..433a9b9a6 100644 --- a/pkg/api/listener.go +++ b/pkg/api/listener.go @@ -24,9 +24,10 @@ package api import ( "context" "fmt" - "github.com/Microsoft/go-winio" "net" "strings" + + "github.com/Microsoft/go-winio" ) // MakePipeListener produces a new listener for receiving requests over a named pipe. @@ -41,6 +42,7 @@ func MakePipeListener(pipePath, descriptor string) (net.Listener, error) { // makeTCPListener produces a new listener for receiving requests over TCP. func makeTCPListener(addr string) (net.Listener, error) { + //nolint:noctx return net.Listen("tcp", addr) } diff --git a/pkg/network/dns.go b/pkg/network/dns.go index d799c6516..eb8b81003 100644 --- a/pkg/network/dns.go +++ b/pkg/network/dns.go @@ -19,6 +19,7 @@ package network import ( + "context" "errors" "expvar" "net" @@ -119,7 +120,9 @@ func (r *ReverseDNS) Add(addr Address) ([]string, error) { now := time.Now() exp := now.Add(r.ttl).UnixNano() - names, err := net.LookupAddr(addr.ToIPString()) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + names, err := net.DefaultResolver.LookupAddr(ctx, addr.ToIPString()) if err != nil { r.blacklist[addr]++ failedDNSLookups.Add(addr.ToIPString(), 1) diff --git a/pkg/outputs/amqp/client.go b/pkg/outputs/amqp/client.go index 57c566e3e..91e66bf78 100644 --- a/pkg/outputs/amqp/client.go +++ b/pkg/outputs/amqp/client.go @@ -21,12 +21,13 @@ package amqp import ( "expvar" "fmt" - "github.com/rabbitstack/fibratus/pkg/util/tls" - log "github.com/sirupsen/logrus" - "github.com/streadway/amqp" "net" "sync" "time" + + "github.com/rabbitstack/fibratus/pkg/util/tls" + log "github.com/sirupsen/logrus" + "github.com/streadway/amqp" ) var ( @@ -55,6 +56,7 @@ func (c *client) connect(healthcheck bool) error { amqpConfig := amqp.Config{ Vhost: c.config.Vhost, Dial: func(network, addr string) (net.Conn, error) { + //nolint:noctx return net.DialTimeout(network, addr, c.config.Timeout) }, SASL: c.config.auth(),