Remove support for go 1.19 (#1449)

* Remove support for go 1.19

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>

* Replace rand.Seed, deprecated in go 1.20

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>

---------

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
This commit is contained in:
Arthur Silva Sens 2024-02-23 14:59:23 -03:00 committed by GitHub
parent 9dd5d2a64a
commit 353395b3b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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 \

View File

@ -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

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/prometheus/client_golang
go 1.19
go 1.20
require (
github.com/beorn7/perks v1.0.1

View File

@ -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()

View File

@ -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))