Skip to content

Commit

Permalink
Remove support for go 1.19 (#1449)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Arthur Silva Sens authored Feb 23, 2024
1 parent 9dd5d2a commit 353395b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/prometheus/client_golang

go 1.19
go 1.20

require (
github.com/beorn7/perks v1.0.1
Expand Down
6 changes: 3 additions & 3 deletions prometheus/histogram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions prometheus/summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 353395b

Please sign in to comment.