Bump minumim required Go version to 1.13
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>
This commit is contained in:
parent
a60c63e313
commit
6635a8f35b
|
@ -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"
|
||||
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
2
go.mod
2
go.mod
|
@ -11,4 +11,4 @@ require (
|
|||
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2
|
||||
)
|
||||
|
||||
go 1.11
|
||||
go 1.13
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
// Copyright 2019 The Prometheus Authors
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build go1.12
|
||||
|
||||
package prometheus
|
||||
|
||||
import "runtime/debug"
|
||||
|
||||
// readBuildInfo is a wrapper around debug.ReadBuildInfo for Go 1.12+.
|
||||
func readBuildInfo() (path, version, sum string) {
|
||||
path, version, sum = "unknown", "unknown", "unknown"
|
||||
if bi, ok := debug.ReadBuildInfo(); ok {
|
||||
path = bi.Main.Path
|
||||
version = bi.Main.Version
|
||||
sum = bi.Main.Sum
|
||||
}
|
||||
return
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright 2019 The Prometheus Authors
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build !go1.12
|
||||
|
||||
package prometheus
|
||||
|
||||
// readBuildInfo is a wrapper around debug.ReadBuildInfo for Go versions before
|
||||
// 1.12. Remove this whole file once the minimum supported Go version is 1.12.
|
||||
func readBuildInfo() (path, version, sum string) {
|
||||
return "unknown", "unknown", "unknown"
|
||||
}
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue