diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b0857bf16..8e01aba2e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 with: - go-version: 1.23.x + go-version: 1.24.x - run: | $TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/discovery.*|github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"} go test $TestTargets -vet=off -v @@ -185,7 +185,7 @@ jobs: uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 with: cache: false - go-version: 1.23.x + go-version: 1.24.x - name: Run goyacc and check for diff run: make install-goyacc check-generated-parser golangci: @@ -197,7 +197,7 @@ jobs: - name: Install Go uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 with: - go-version: 1.23.x + go-version: 1.24.x - name: Install snmp_exporter/generator dependencies run: sudo apt-get update && sudo apt-get -y install libsnmp-dev if: github.repository == 'prometheus/snmp_exporter' @@ -206,7 +206,7 @@ jobs: with: args: --verbose # Make sure to sync this with Makefile.common and scripts/golangci-lint.yml. - version: v1.63.4 + version: v1.64.6 fuzzing: uses: ./.github/workflows/fuzzing.yml if: github.event_name == 'pull_request' diff --git a/.promu.yml b/.promu.yml index 6feaa6ef64..23379cc1ef 100644 --- a/.promu.yml +++ b/.promu.yml @@ -1,7 +1,7 @@ go: # Whenever the Go version is updated here, # .github/workflows should also be updated. - version: 1.23 + version: 1.24 repository: path: github.com/prometheus/prometheus build: diff --git a/Makefile.common b/Makefile.common index d1576bb313..8cb3838598 100644 --- a/Makefile.common +++ b/Makefile.common @@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_ SKIP_GOLANGCI_LINT := GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v1.63.4 +GOLANGCI_LINT_VERSION ?= v1.64.6 # golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) diff --git a/promql/parser/lex.go b/promql/parser/lex.go index 7210d51b7b..52658f318c 100644 --- a/promql/parser/lex.go +++ b/promql/parser/lex.go @@ -429,11 +429,10 @@ func lexStatements(l *Lexer) stateFn { l.emit(EQL) } case r == '!': - if t := l.next(); t == '=' { - l.emit(NEQ) - } else { + if t := l.next(); t != '=' { return l.errorf("unexpected character after '!': %q", t) } + l.emit(NEQ) case r == '<': if t := l.peek(); t == '=' { l.next() diff --git a/promql/parser/parse.go b/promql/parser/parse.go index 9bf27264a8..5ace332d71 100644 --- a/promql/parser/parse.go +++ b/promql/parser/parse.go @@ -72,7 +72,7 @@ func WithFunctions(functions map[string]*Function) Opt { } // NewParser returns a new parser. -func NewParser(input string, opts ...Opt) *parser { //nolint:revive // unexported-return. +func NewParser(input string, opts ...Opt) *parser { //nolint:revive // unexported-return p := parserPool.Get().(*parser) p.functions = Functions diff --git a/scripts/golangci-lint.yml b/scripts/golangci-lint.yml index def9007ac6..0bc1bfe8a8 100644 --- a/scripts/golangci-lint.yml +++ b/scripts/golangci-lint.yml @@ -28,7 +28,7 @@ jobs: - name: Install Go uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 with: - go-version: 1.23.x + go-version: 1.24.x - name: Install snmp_exporter/generator dependencies run: sudo apt-get update && sudo apt-get -y install libsnmp-dev if: github.repository == 'prometheus/snmp_exporter' @@ -36,4 +36,4 @@ jobs: uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0 with: args: --verbose - version: v1.63.4 + version: v1.64.6 diff --git a/tsdb/errors/errors.go b/tsdb/errors/errors.go index ff230c44b1..a86ce59bd8 100644 --- a/tsdb/errors/errors.go +++ b/tsdb/errors/errors.go @@ -25,7 +25,7 @@ import ( type multiError []error // NewMulti returns multiError with provided errors added if not nil. -func NewMulti(errs ...error) multiError { //nolint:revive // unexported-return. +func NewMulti(errs ...error) multiError { //nolint:revive // unexported-return m := multiError{} m.Add(errs...) return m diff --git a/tsdb/ooo_head.go b/tsdb/ooo_head.go index 0ed9f36484..85a56e5895 100644 --- a/tsdb/ooo_head.go +++ b/tsdb/ooo_head.go @@ -72,7 +72,7 @@ func (o *OOOChunk) NumSamples() int { // ToEncodedChunks returns chunks with the samples in the OOOChunk. // -//nolint:revive // unexported-return. +//nolint:revive // unexported-return func (o *OOOChunk) ToEncodedChunks(mint, maxt int64) (chks []memChunk, err error) { if len(o.samples) == 0 { return nil, nil diff --git a/tsdb/ooo_head_read_test.go b/tsdb/ooo_head_read_test.go index adbd3278ba..488caaeda7 100644 --- a/tsdb/ooo_head_read_test.go +++ b/tsdb/ooo_head_read_test.go @@ -385,7 +385,7 @@ func TestOOOHeadChunkReader_LabelValues(t *testing.T) { } } -//nolint:revive // unexported-return. +//nolint:revive // unexported-return func testOOOHeadChunkReader_LabelValues(t *testing.T, scenario sampleTypeScenario) { chunkRange := int64(2000) head, _ := newTestHead(t, chunkRange, wlog.CompressionNone, true) @@ -489,7 +489,7 @@ func TestOOOHeadChunkReader_Chunk(t *testing.T) { } } -//nolint:revive // unexported-return. +//nolint:revive // unexported-return func testOOOHeadChunkReader_Chunk(t *testing.T, scenario sampleTypeScenario) { opts := DefaultOptions() opts.OutOfOrderCapMax = 5 @@ -900,7 +900,7 @@ func TestOOOHeadChunkReader_Chunk_ConsistentQueryResponseDespiteOfHeadExpanding( } } -//nolint:revive // unexported-return. +//nolint:revive // unexported-return func testOOOHeadChunkReader_Chunk_ConsistentQueryResponseDespiteOfHeadExpanding(t *testing.T, scenario sampleTypeScenario) { opts := DefaultOptions() opts.OutOfOrderCapMax = 5