chore: Update go to v1.24.0 (#16549)

This commit is contained in:
Sven Rebhan 2025-02-25 00:46:57 +01:00 committed by GitHub
parent 1ad4b64bcc
commit 7d181b7a75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 19 additions and 32 deletions

View File

@ -8,7 +8,7 @@ executors:
working_directory: '/go/src/github.com/influxdata/telegraf'
resource_class: large
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.23.5'
- image: 'quay.io/influxdb/telegraf-ci:1.24.0'
environment:
GOFLAGS: -p=4
mac:

View File

@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.23.5'
go-version: '1.24.0'
- uses: actions/checkout@v4
with:
fetch-depth: 0

View File

@ -352,13 +352,10 @@ linters-settings:
- suite-thelper
- useless-assert
usetesting:
# Enable/disable `os.CreateTemp("", ...)` detections.
# Default: true
os-create-temp: false
# Enable/disable `os.MkdirTemp()` detections.
# Default: true
os-mkdir-temp: false
context-background: false
context-todo: false
issues:
# List of regexps of issue texts to exclude.

View File

@ -257,8 +257,8 @@ plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl
.PHONY: ci
ci:
docker build -t quay.io/influxdb/telegraf-ci:1.23.5 - < scripts/ci.docker
docker push quay.io/influxdb/telegraf-ci:1.23.5
docker build -t quay.io/influxdb/telegraf-ci:1.24.0 - < scripts/ci.docker
docker push quay.io/influxdb/telegraf-ci:1.24.0
.PHONY: install
install: $(buildbin)

View File

@ -42,28 +42,18 @@ import (
func TestReadBinaryFile(t *testing.T) {
// Create a temporary binary file using the Telegraf tool custom_builder to pass as a config
wd, err := os.Getwd()
require.NoError(t, err)
t.Cleanup(func() {
err := os.Chdir(wd)
require.NoError(t, err)
})
err = os.Chdir("../")
require.NoError(t, err)
t.Chdir("..")
tmpdir := t.TempDir()
binaryFile := filepath.Join(tmpdir, "custom_builder")
cmd := exec.Command("go", "build", "-o", binaryFile, "./tools/custom_builder")
var outb, errb bytes.Buffer
cmd.Stdout = &outb
cmd.Stderr = &errb
err = cmd.Run()
require.NoErrorf(t, cmd.Run(), "stdout: %s, stderr: %s", outb.String(), errb.String())
require.NoErrorf(t, err, "stdout: %s, stderr: %s", outb.String(), errb.String())
c := config.NewConfig()
err = c.LoadConfig(binaryFile)
require.Error(t, err)
require.ErrorContains(t, err, "provided config is not a TOML file")
require.ErrorContains(t, c.LoadConfig(binaryFile), "provided config is not a TOML file")
}
func TestConfig_LoadSingleInputWithEnvVars(t *testing.T) {

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/influxdata/telegraf
go 1.23.0
go 1.24.0
godebug x509negativeserial=1

View File

@ -165,7 +165,7 @@ func (b *Beanstalkd) gatherTubeStats(connection *textproto.Conn, tube string, ac
}
func runQuery(connection *textproto.Conn, cmd string, result interface{}) error {
requestID, err := connection.Cmd(cmd)
requestID, err := connection.Cmd("%s", cmd)
if err != nil {
return err
}

View File

@ -1,4 +1,4 @@
FROM golang:1.23.5
FROM golang:1.24.0
RUN chmod -R 755 "$GOPATH"

View File

@ -2,10 +2,10 @@
set -eux
GO_VERSION="1.23.5"
GO_VERSION="1.24.0"
GO_ARCH="linux-amd64"
# from https://go.dev/dl
GO_VERSION_SHA="cbcad4a6482107c7c7926df1608106c189417163428200ce357695cc7e01d091"
GO_VERSION_SHA="dea9ca38a0b852a74e81c26134671af7c0fbe65d81b0dc1c5bfe22cf7d4c8858"
# Download Go and verify Go tarball
setup_go () {

View File

@ -3,9 +3,9 @@
set -eux
ARCH=$(uname -m)
GO_VERSION="1.23.5"
GO_VERSION_SHA_arm64="047bfce4fbd0da6426bd30cd19716b35a466b1c15a45525ce65b9824acb33285" # from https://go.dev/dl
GO_VERSION_SHA_amd64="d8b310b0b6bd6a630307579165cfac8a37571483c7d6804a10dd73bbefb0827f" # from https://go.dev/dl
GO_VERSION="1.24.0"
GO_VERSION_SHA_arm64="fd9cfb5dd6c75a347cfc641a253f0db1cebaca16b0dd37965351c6184ba595e4" # from https://go.dev/dl
GO_VERSION_SHA_amd64="7af054e5088b68c24b3d6e135e5ca8d91bbd5a05cb7f7f0187367b3e6e9e05ee" # from https://go.dev/dl
if [ "$ARCH" = 'arm64' ]; then
GO_ARCH="darwin-arm64"

View File

@ -2,7 +2,7 @@
set -eux
GO_VERSION="1.23.5"
GO_VERSION="1.24.0"
setup_go () {
choco upgrade golang --allow-downgrade --version=${GO_VERSION}