Skip to content

Commit

Permalink
config: ignore deprecated warning in tests (#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 Jul 11, 2022
1 parent b86ea81 commit c5e1b60
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions config/http_config_test.go
Original file line number Diff line number Diff line change
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 c5e1b60

Please sign in to comment.