From 353395b3b67b2bee0a219950bf5570779d74a392 Mon Sep 17 00:00:00 2001 From: Arthur Silva Sens Date: Fri, 23 Feb 2024 14:59:23 -0300 Subject: [PATCH] Remove support for go 1.19 (#1449) * Remove support for go 1.19 Signed-off-by: Arthur Silva Sens * Replace rand.Seed, deprecated in go 1.20 Signed-off-by: Arthur Silva Sens --------- Signed-off-by: Arthur Silva Sens --- .github/workflows/go.yml | 2 +- Makefile | 2 +- README.md | 4 ++-- go.mod | 2 +- prometheus/histogram_test.go | 6 +++--- prometheus/summary_test.go | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ed7f0f4..c72b96c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: - go_version: ["1.19", "1.20", "1.21", "1.22"] + go_version: ["1.20", "1.21", "1.22"] steps: - name: Checkout code diff --git a/Makefile b/Makefile index 709f3a4..1c5eb70 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ test: deps common-test test-short: deps common-test-short .PHONY: generate-go-collector-test-files -VERSIONS := 1.19 1.20 1.21 1.22 +VERSIONS := 1.20 1.21 1.22 generate-go-collector-test-files: for GO_VERSION in $(VERSIONS); do \ docker run \ diff --git a/README.md b/README.md index 21be4ee..f1019d0 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ This is the [Go](http://golang.org) client library for instrumenting application code, and one for creating clients that talk to the Prometheus HTTP API. -**This library requires Go1.19 or later.** -> The library mandates the use of Go1.19 or subsequent versions. While it has demonstrated functionality with versions as old as Go 1.17, our commitment remains to offer support and rectifications for only the most recent three major releases. +**This library requires Go1.20 or later.** +> The library mandates the use of Go1.20 or subsequent versions. While it has demonstrated functionality with versions as old as Go 1.17, our commitment remains to offer support and rectifications for only the most recent three major releases. ## Important note about releases and stability diff --git a/go.mod b/go.mod index 1199beb..94b9d79 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/prometheus/client_golang -go 1.19 +go 1.20 require ( github.com/beorn7/perks v1.0.1 diff --git a/prometheus/histogram_test.go b/prometheus/histogram_test.go index 413b3f8..39bb0dc 100644 --- a/prometheus/histogram_test.go +++ b/prometheus/histogram_test.go @@ -157,7 +157,7 @@ func TestHistogramConcurrency(t *testing.T) { t.Skip("Skipping test in short mode.") } - rand.Seed(42) + rand.New(rand.NewSource(42)) it := func(n uint32) bool { mutations := int(n%1e4 + 1e4) @@ -243,7 +243,7 @@ func TestHistogramVecConcurrency(t *testing.T) { t.Skip("Skipping test in short mode.") } - rand.Seed(42) + rand.New(rand.NewSource(42)) it := func(n uint32) bool { mutations := int(n%1e4 + 1e4) @@ -1010,7 +1010,7 @@ func TestNativeHistogramConcurrency(t *testing.T) { t.Skip("Skipping test in short mode.") } - rand.Seed(42) + rand.New(rand.NewSource(42)) it := func(n uint32) bool { ts := time.Now().Add(30 * time.Second).Unix() diff --git a/prometheus/summary_test.go b/prometheus/summary_test.go index 2a0d1f3..d1ea072 100644 --- a/prometheus/summary_test.go +++ b/prometheus/summary_test.go @@ -203,7 +203,7 @@ func TestSummaryConcurrency(t *testing.T) { t.Skip("Skipping test in short mode.") } - rand.Seed(42) + rand.New(rand.NewSource(42)) objMap := map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001} it := func(n uint32) bool { @@ -284,7 +284,7 @@ func TestSummaryVecConcurrency(t *testing.T) { t.Skip("Skipping test in short mode.") } - rand.Seed(42) + rand.New(rand.NewSource(42)) objMap := map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001} objSlice := make([]float64, 0, len(objMap))