Skip to content

Commit

Permalink
Bump minumim required Go version to 1.13
Browse files Browse the repository at this point in the history
Since 1.16 is out, we still support the last four minor releases.

The bump was required by the prometheus/procfs package using the new
`%w` printf directives. However, it also allows us to remove some
special casing about build info.

Signed-off-by: beorn7 <beorn@grafana.com>
  • Loading branch information
beorn7 committed Mar 11, 2021
1 parent a60c63e commit 6635a8f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 70 deletions.
20 changes: 4 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,6 @@ workflows:
client_golang:
jobs:
# Refer to README.md for the currently supported versions.
- test:
name: go-1-9
go_version: "1.9"
use_gomod_cache: false
- test:
name: go-1-10
go_version: "1.10"
use_gomod_cache: false
- test:
name: go-1-11
go_version: "1.11"
run_lint: true
- test:
name: go-1-12
go_version: "1.12"
run_lint: true
- test:
name: go-1-13
go_version: "1.13"
Expand All @@ -78,6 +62,10 @@ workflows:
name: go-1-15
go_version: "1.15"
run_lint: true
- test:
name: go-1-16
go_version: "1.16"
run_lint: true
# Style and unused/missing packages are only checked against
# the latest supported Go version.
run_style_and_unused: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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.9 or later.__ The minimum required patch releases for older Go versions are Go1.9.7 and Go1.10.3.
__This library requires Go1.13 or later.__

## 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
Expand Up @@ -11,4 +11,4 @@ require (
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2
)

go 1.11
go 1.13
29 changes: 0 additions & 29 deletions prometheus/build_info.go

This file was deleted.

22 changes: 0 additions & 22 deletions prometheus/build_info_pre_1.12.go

This file was deleted.

7 changes: 6 additions & 1 deletion prometheus/go_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,12 @@ type memStatsMetrics []struct {
// https://github.com/povilasv/prommod for an example of a collector for the
// module dependencies.
func NewBuildInfoCollector() Collector {
path, version, sum := readBuildInfo()
path, version, sum := "unknown", "unknown", "unknown"
if bi, ok := debug.ReadBuildInfo(); ok {
path = bi.Main.Path
version = bi.Main.Version
sum = bi.Main.Sum
}
c := &selfCollector{MustNewConstMetric(
NewDesc(
"go_build_info",
Expand Down

0 comments on commit 6635a8f

Please sign in to comment.