Skip to content

Commit 10e1378

Browse files
author
Julien Pivotto
committed
Support go 1.16
Signed-off-by: Julien Pivotto <[email protected]>
1 parent 517c52c commit 10e1378

File tree

5 files changed

+14
-63
lines changed

5 files changed

+14
-63
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,8 @@ workflows:
6666
- test:
6767
name: go-1-15
6868
go_version: "1.15"
69+
- test:
70+
name: go-1-16
71+
go_version: "1.16"
6972
# Style is only checked against the latest supported Go version.
7073
run_style: true

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Common
2-
[![Build Status](https://travis-ci.org/prometheus/common.svg)](https://travis-ci.org/prometheus/common)
2+
[![circleci](https://circleci.com/gh/prometheus/common/tree/master.svg?style=shield)][circleci]
33

44
This repository contains Go libraries that are shared across Prometheus
55
components and libraries. They are considered internal to Prometheus, without

config/http_config_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,17 @@ func TestTLSConfig(t *testing.T) {
513513
t.Fatalf("Unexpected client certificate result: \n\n%+v\n expected\n\n%+v", cert, clientCertificate)
514514
}
515515

516-
// non-nil functions are never equal.
516+
// tlsConfig.rootCAs.LazyCerts contains functions getCert() in go 1.16, which are
517+
// never equal. Compare the Subjects instead.
518+
if !reflect.DeepEqual(tlsConfig.RootCAs.Subjects(), expectedTLSConfig.RootCAs.Subjects()) {
519+
t.Fatalf("Unexpected RootCAs result: \n\n%+v\n expected\n\n%+v", tlsConfig.RootCAs.Subjects(), expectedTLSConfig.RootCAs.Subjects())
520+
}
521+
tlsConfig.RootCAs = nil
522+
expectedTLSConfig.RootCAs = nil
523+
524+
// Non-nil functions are never equal.
517525
tlsConfig.GetClientCertificate = nil
526+
518527
if !reflect.DeepEqual(tlsConfig, expectedTLSConfig) {
519528
t.Fatalf("Unexpected TLS Config result: \n\n%+v\n expected\n\n%+v", tlsConfig, expectedTLSConfig)
520529
}

0 commit comments

Comments
 (0)