chore: Update to go1.20 (#12593)

This commit is contained in:
Joshua Powers 2023-02-03 01:47:02 -07:00 committed by GitHub
parent cde651b7ee
commit bf108da447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 11 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.19.5'
- image: 'quay.io/influxdb/telegraf-ci:1.20'
environment:
GOFLAGS: -p=4
mac:

View File

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

View File

@ -708,7 +708,7 @@ func TestParseTimestampInvalid(t *testing.T) {
name: "layout not matching time",
format: "rfc3339",
timestamp: "09.07.2019 00:11:00",
expected: "cannot parse \"7.2019 00:11:00\" as \"2006\"",
expected: "cannot parse \"09.07.2019 00:11:00\" as \"2006\"",
},
{
name: "unix wrong type",

View File

@ -40,6 +40,10 @@ func TestGather(t *testing.T) {
"update_interval": 507.2,
}
// tests on linux with go1.20 will add a warning about code coverage
// due to the code coverage dir not being set
delete(acc.Metrics[0].Tags, "warning")
acc.AssertContainsTaggedFields(t, "chrony", fields, tags)
// test with dns lookup

View File

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

View File

@ -2,10 +2,10 @@
set -eux
GO_VERSION="1.19.5"
GO_VERSION="1.20"
GO_ARCH="linux-amd64"
# from https://golang.org/dl
GO_VERSION_SHA="36519702ae2fd573c9869461990ae550c8c0d955cd28d2827a6b159fda81ff95"
GO_VERSION_SHA="5a9ebcc65c1cce56e0d2dc616aff4c4cedcfbda8cc6f0288cc08cda3b18dcbf1"
# Download Go and verify Go tarball
setup_go () {

View File

@ -3,9 +3,9 @@
set -eux
ARCH=$(uname -m)
GO_VERSION="1.19.5"
GO_VERSION_SHA_arm64="4a67f2bf0601afe2177eb58f825adf83509511d77ab79174db0712dc9efa16c8" # from https://golang.org/dl
GO_VERSION_SHA_amd64="23d22bb6571bbd60197bee8aaa10e702f9802786c2e2ddce5c84527e86b66aa0" # from https://golang.org/dl
GO_VERSION="1.20"
GO_VERSION_SHA_arm64="32864d6fe888714ca7b421b5997269c7f6349d7e2675c3a399133e521787608b" # from https://golang.org/dl
GO_VERSION_SHA_amd64="777025500f62d14bb5a4923072cd97431887961d24de08433a60c2fe1120531d" # from https://golang.org/dl
if [ "$ARCH" = 'arm64' ]; then
GO_ARCH="darwin-arm64"

View File

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