Skip to content

Commit

Permalink
config: ignore deprecated warning in tests (prometheus#389)
Browse files Browse the repository at this point in the history
(*CertPool).Subjects is deprecated in Go 1.18 because it may not include
the system certs but it isn't a problem for the tests because we're not
loading the system certs.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
  • Loading branch information
simonpasquier authored and radek-ryckowski committed May 22, 2023
1 parent 9dee887 commit aef35f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions config/http_config_test.go
Expand Up @@ -664,6 +664,7 @@ func TestTLSConfig(t *testing.T) {

// tlsConfig.rootCAs.LazyCerts contains functions getCert() in go 1.16, which are
// never equal. Compare the Subjects instead.
//nolint:staticcheck // Ignore SA1019. (*CertPool).Subjects is deprecated because it may not include the system certs but it isn't the case here.
if !reflect.DeepEqual(tlsConfig.RootCAs.Subjects(), expectedTLSConfig.RootCAs.Subjects()) {
t.Fatalf("Unexpected RootCAs result: \n\n%+v\n expected\n\n%+v", tlsConfig.RootCAs.Subjects(), expectedTLSConfig.RootCAs.Subjects())
}
Expand Down

0 comments on commit aef35f1

Please sign in to comment.