Skip to content

Commit

Permalink
Added support for go 1.20.
Browse files Browse the repository at this point in the history
Signed-off-by: bwplotka <bwplotka@gmail.com>
  • Loading branch information
bwplotka committed Mar 17, 2023
1 parent 3d2cf0b commit 2172435
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ workflows:
name: go-1-19
go_version: "1.19"
run_lint: true
- test:
name: go-1-20
go_version: "1.20"
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test: deps common-test
test-short: deps common-test-short

.PHONY: generate-go-collector-test-files
VERSIONS := 1.17 1.18 1.19
VERSIONS := 1.17 1.18 1.19 1.20
generate-go-collector-test-files:
for GO_VERSION in $(VERSIONS); do \
docker run --rm -v $(PWD):/workspace -w /workspace golang:$$GO_VERSION go run prometheus/gen_go_collector_metrics_set.go; \
Expand Down
4 changes: 3 additions & 1 deletion prometheus/gen_go_collector_metrics_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ func main() {
if err != nil {
log.Fatal(err)
}
gv, err := version.NewVersion(strings.TrimPrefix(toolVersion, "go"))

toolVersion = strings.Split(strings.TrimPrefix(toolVersion, "go"), " ")[0]
gv, err := version.NewVersion(toolVersion)
if err != nil {
log.Fatal(err)
}
Expand Down
57 changes: 57 additions & 0 deletions prometheus/go_collector_metrics_go120_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2172435

Please sign in to comment.