mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-06 14:17:12 +02:00
Upgrade to Go v1.24 (#16180)
* Upgrade to Go v1.24 * Upgrade golangci-lint --------- Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
f03a9916fe
commit
56929ffa42
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@ -82,7 +82,7 @@ jobs:
|
|||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
|
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
|
||||||
with:
|
with:
|
||||||
go-version: 1.23.x
|
go-version: 1.24.x
|
||||||
- run: |
|
- run: |
|
||||||
$TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/discovery.*|github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"}
|
$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
|
go test $TestTargets -vet=off -v
|
||||||
@ -185,7 +185,7 @@ jobs:
|
|||||||
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
|
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
|
||||||
with:
|
with:
|
||||||
cache: false
|
cache: false
|
||||||
go-version: 1.23.x
|
go-version: 1.24.x
|
||||||
- name: Run goyacc and check for diff
|
- name: Run goyacc and check for diff
|
||||||
run: make install-goyacc check-generated-parser
|
run: make install-goyacc check-generated-parser
|
||||||
golangci:
|
golangci:
|
||||||
@ -197,7 +197,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
|
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
|
||||||
with:
|
with:
|
||||||
go-version: 1.23.x
|
go-version: 1.24.x
|
||||||
- name: Install snmp_exporter/generator dependencies
|
- name: Install snmp_exporter/generator dependencies
|
||||||
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
|
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
|
||||||
if: github.repository == 'prometheus/snmp_exporter'
|
if: github.repository == 'prometheus/snmp_exporter'
|
||||||
@ -206,7 +206,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
args: --verbose
|
args: --verbose
|
||||||
# Make sure to sync this with Makefile.common and scripts/golangci-lint.yml.
|
# Make sure to sync this with Makefile.common and scripts/golangci-lint.yml.
|
||||||
version: v1.63.4
|
version: v1.64.6
|
||||||
fuzzing:
|
fuzzing:
|
||||||
uses: ./.github/workflows/fuzzing.yml
|
uses: ./.github/workflows/fuzzing.yml
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
go:
|
go:
|
||||||
# Whenever the Go version is updated here,
|
# Whenever the Go version is updated here,
|
||||||
# .github/workflows should also be updated.
|
# .github/workflows should also be updated.
|
||||||
version: 1.23
|
version: 1.24
|
||||||
repository:
|
repository:
|
||||||
path: github.com/prometheus/prometheus
|
path: github.com/prometheus/prometheus
|
||||||
build:
|
build:
|
||||||
|
@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
|
|||||||
SKIP_GOLANGCI_LINT :=
|
SKIP_GOLANGCI_LINT :=
|
||||||
GOLANGCI_LINT :=
|
GOLANGCI_LINT :=
|
||||||
GOLANGCI_LINT_OPTS ?=
|
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.
|
# 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.
|
# windows isn't included here because of the path separator being different.
|
||||||
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
|
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
|
||||||
|
@ -429,11 +429,10 @@ func lexStatements(l *Lexer) stateFn {
|
|||||||
l.emit(EQL)
|
l.emit(EQL)
|
||||||
}
|
}
|
||||||
case r == '!':
|
case r == '!':
|
||||||
if t := l.next(); t == '=' {
|
if t := l.next(); t != '=' {
|
||||||
l.emit(NEQ)
|
|
||||||
} else {
|
|
||||||
return l.errorf("unexpected character after '!': %q", t)
|
return l.errorf("unexpected character after '!': %q", t)
|
||||||
}
|
}
|
||||||
|
l.emit(NEQ)
|
||||||
case r == '<':
|
case r == '<':
|
||||||
if t := l.peek(); t == '=' {
|
if t := l.peek(); t == '=' {
|
||||||
l.next()
|
l.next()
|
||||||
|
@ -72,7 +72,7 @@ func WithFunctions(functions map[string]*Function) Opt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewParser returns a new parser.
|
// 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 := parserPool.Get().(*parser)
|
||||||
|
|
||||||
p.functions = Functions
|
p.functions = Functions
|
||||||
|
@ -28,7 +28,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
|
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
|
||||||
with:
|
with:
|
||||||
go-version: 1.23.x
|
go-version: 1.24.x
|
||||||
- name: Install snmp_exporter/generator dependencies
|
- name: Install snmp_exporter/generator dependencies
|
||||||
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
|
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
|
||||||
if: github.repository == 'prometheus/snmp_exporter'
|
if: github.repository == 'prometheus/snmp_exporter'
|
||||||
@ -36,4 +36,4 @@ jobs:
|
|||||||
uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0
|
uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0
|
||||||
with:
|
with:
|
||||||
args: --verbose
|
args: --verbose
|
||||||
version: v1.63.4
|
version: v1.64.6
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
type multiError []error
|
type multiError []error
|
||||||
|
|
||||||
// NewMulti returns multiError with provided errors added if not nil.
|
// 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 := multiError{}
|
||||||
m.Add(errs...)
|
m.Add(errs...)
|
||||||
return m
|
return m
|
||||||
|
@ -72,7 +72,7 @@ func (o *OOOChunk) NumSamples() int {
|
|||||||
|
|
||||||
// ToEncodedChunks returns chunks with the samples in the OOOChunk.
|
// 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) {
|
func (o *OOOChunk) ToEncodedChunks(mint, maxt int64) (chks []memChunk, err error) {
|
||||||
if len(o.samples) == 0 {
|
if len(o.samples) == 0 {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
@ -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) {
|
func testOOOHeadChunkReader_LabelValues(t *testing.T, scenario sampleTypeScenario) {
|
||||||
chunkRange := int64(2000)
|
chunkRange := int64(2000)
|
||||||
head, _ := newTestHead(t, chunkRange, wlog.CompressionNone, true)
|
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) {
|
func testOOOHeadChunkReader_Chunk(t *testing.T, scenario sampleTypeScenario) {
|
||||||
opts := DefaultOptions()
|
opts := DefaultOptions()
|
||||||
opts.OutOfOrderCapMax = 5
|
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) {
|
func testOOOHeadChunkReader_Chunk_ConsistentQueryResponseDespiteOfHeadExpanding(t *testing.T, scenario sampleTypeScenario) {
|
||||||
opts := DefaultOptions()
|
opts := DefaultOptions()
|
||||||
opts.OutOfOrderCapMax = 5
|
opts.OutOfOrderCapMax = 5
|
||||||
|
Loading…
Reference in New Issue
Block a user