From b1e27938cb485274a3a2019f4ff9b2533b8be601 Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Fri, 10 Mar 2023 14:04:04 +0900 Subject: [PATCH] Update DEFAULT_GO_VERSION to 1.20 and drop 1.18 on compatibility-test Signed-off-by: Koichi Shiraishi --- .github/workflows/ci.yml | 4 ++-- Makefile | 2 +- detectors/gcp/go.mod | 2 +- e2e-test-server/cloud_functions/go.mod | 2 +- e2e-test-server/go.mod | 2 +- example/metric/example.go | 7 +++---- example/metric/go.mod | 2 +- example/trace/http/go.mod | 2 +- exporter/collector/go.mod | 2 +- exporter/collector/googlemanagedprometheus/go.mod | 2 +- exporter/collector/integrationtest/go.mod | 2 +- exporter/metric/go.mod | 2 +- exporter/trace/go.mod | 2 +- go.mod | 2 +- internal/cloudmock/go.mod | 2 +- internal/resourcemapping/go.mod | 2 +- propagator/go.mod | 2 +- tools/go.mod | 2 +- 18 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7585ceeb9..556cab885 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ env: # Path to where test results will be saved. TEST_RESULTS: /tmp/test-results # Default minimum version of Go to support. - DEFAULT_GO_VERSION: 1.19 + DEFAULT_GO_VERSION: "1.20" jobs: lint: runs-on: ubuntu-latest @@ -113,7 +113,7 @@ jobs: compatibility-test: strategy: matrix: - go-version: [1.19, 1.18] + go-version: ["1.20", 1.19] os: [ubuntu-latest, macos-latest, windows-latest] arch: ["386", amd64] exclude: diff --git a/Makefile b/Makefile index 130948c23..6101b84b7 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,7 @@ for-all-package: .PHONY: gotidy gotidy: - $(MAKE) for-all-mod CMD="go mod tidy -compat=1.18" + $(MAKE) for-all-mod CMD="go mod tidy -compat=1.19" .PHONY: update-dep update-dep: diff --git a/detectors/gcp/go.mod b/detectors/gcp/go.mod index f3f4bebb1..5f253a501 100644 --- a/detectors/gcp/go.mod +++ b/detectors/gcp/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp -go 1.19 +go 1.20 require ( cloud.google.com/go/compute v1.10.0 diff --git a/e2e-test-server/cloud_functions/go.mod b/e2e-test-server/cloud_functions/go.mod index bba0c600c..2d2b6f6eb 100644 --- a/e2e-test-server/cloud_functions/go.mod +++ b/e2e-test-server/cloud_functions/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/e2e-test-server/cloudfunctions -go 1.19 +go 1.20 require ( cloud.google.com/go/pubsub v1.28.0 diff --git a/e2e-test-server/go.mod b/e2e-test-server/go.mod index f3fa17ab7..7348824af 100644 --- a/e2e-test-server/go.mod +++ b/e2e-test-server/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/e2e-test-server -go 1.19 +go 1.20 require ( cloud.google.com/go/pubsub v1.27.1 diff --git a/example/metric/example.go b/example/metric/example.go index f340b40cf..121186dba 100644 --- a/example/metric/example.go +++ b/example/metric/example.go @@ -109,14 +109,13 @@ func main() { // Add measurement once an every 10 second. timer := time.NewTicker(10 * time.Second) + rng := rand.New(rand.NewSource(time.Now().UnixNano())) for range timer.C { - rand.Seed(time.Now().UnixNano()) - - r := rand.Int63n(100) + r := rng.Int63n(100) cv := 100 + r counter.Add(ctx, cv, clabels...) - r2 := rand.Int63n(100) + r2 := rng.Int63n(100) hv := float64(r2) / 20.0 histogram.Record(ctx, hv, clabels...) ov := 12.34 + hv diff --git a/example/metric/go.mod b/example/metric/go.mod index 42235a3c8..c1ae5e1cc 100644 --- a/example/metric/go.mod +++ b/example/metric/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/example/metric -go 1.19 +go 1.20 require ( github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.36.0 diff --git a/example/trace/http/go.mod b/example/trace/http/go.mod index 113be5848..bacfecb12 100644 --- a/example/trace/http/go.mod +++ b/example/trace/http/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/example/trace/http -go 1.19 +go 1.20 require ( github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.12.0 diff --git a/exporter/collector/go.mod b/exporter/collector/go.mod index a5b3477ae..8e6440323 100644 --- a/exporter/collector/go.mod +++ b/exporter/collector/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector -go 1.19 +go 1.20 require ( cloud.google.com/go/logging v1.6.1 diff --git a/exporter/collector/googlemanagedprometheus/go.mod b/exporter/collector/googlemanagedprometheus/go.mod index b3e61b030..f05c6c354 100644 --- a/exporter/collector/googlemanagedprometheus/go.mod +++ b/exporter/collector/googlemanagedprometheus/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector/googlemanagedprometheus -go 1.19 +go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.73.0 diff --git a/exporter/collector/integrationtest/go.mod b/exporter/collector/integrationtest/go.mod index d5d2e33a1..1b0cc941b 100644 --- a/exporter/collector/integrationtest/go.mod +++ b/exporter/collector/integrationtest/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector/internal/integrationtest -go 1.19 +go 1.20 require ( cloud.google.com/go/logging v1.6.1 diff --git a/exporter/metric/go.mod b/exporter/metric/go.mod index 6374a380c..a2a6604c8 100644 --- a/exporter/metric/go.mod +++ b/exporter/metric/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric -go 1.19 +go 1.20 require ( cloud.google.com/go/monitoring v1.12.0 diff --git a/exporter/trace/go.mod b/exporter/trace/go.mod index caaab4474..13697a3c2 100644 --- a/exporter/trace/go.mod +++ b/exporter/trace/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace -go 1.19 +go 1.20 require ( cloud.google.com/go/trace v1.8.0 diff --git a/go.mod b/go.mod index 52854080b..afc4ce67e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go -go 1.19 +go 1.20 retract ( v1.8.0 diff --git a/internal/cloudmock/go.mod b/internal/cloudmock/go.mod index c436aa8dd..40b275ef4 100644 --- a/internal/cloudmock/go.mod +++ b/internal/cloudmock/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock -go 1.19 +go 1.20 require ( google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55 diff --git a/internal/resourcemapping/go.mod b/internal/resourcemapping/go.mod index 996ecba29..e937acf85 100644 --- a/internal/resourcemapping/go.mod +++ b/internal/resourcemapping/go.mod @@ -1,5 +1,5 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping -go 1.19 +go 1.20 require go.opentelemetry.io/otel v1.14.0 diff --git a/propagator/go.mod b/propagator/go.mod index 6276fbfa9..c51821edc 100644 --- a/propagator/go.mod +++ b/propagator/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/propagator -go 1.19 +go 1.20 require ( github.com/google/go-cmp v0.5.9 diff --git a/tools/go.mod b/tools/go.mod index 09b666b1b..424a6fdbd 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/opentelemetry-operations-go/tools -go 1.19 +go 1.20 require ( github.com/client9/misspell v0.3.4