From 403aae0467864ac74288df70e0b9a598c01b410f Mon Sep 17 00:00:00 2001 From: tangcong Date: Mon, 20 Apr 2020 10:30:28 +0800 Subject: [PATCH] fix client-go util staticcheck error Kubernetes-commit: 16c3ef2df8c12fcc4bc2596788fb6ee565b8eed8 --- util/cert/csr_test.go | 2 +- util/certificate/certificate_store_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cert/csr_test.go b/util/cert/csr_test.go index 0e80aad2..d546ec79 100644 --- a/util/cert/csr_test.go +++ b/util/cert/csr_test.go @@ -49,7 +49,7 @@ func TestMakeCSR(t *testing.T) { } csrBlock, rest := pem.Decode(csrPEM) if csrBlock == nil { - t.Error("Unable to decode MakeCSR result.") + t.Fatal("Unable to decode MakeCSR result.") } if len(rest) != 0 { t.Error("Found more than one PEM encoded block in the result.") diff --git a/util/certificate/certificate_store_test.go b/util/certificate/certificate_store_test.go index 4bb9e1a2..6d59f9dc 100644 --- a/util/certificate/certificate_store_test.go +++ b/util/certificate/certificate_store_test.go @@ -314,7 +314,7 @@ func TestUpdateTwoCerts(t *testing.T) { t.Errorf("Got %v while updating certificate store.", err) } if cert == nil { - t.Errorf("Got nil certificate, expected something real.") + t.Fatalf("Got nil certificate, expected something real.") } if len(cert.Certificate) != 2 { t.Fatalf("Unexpected number of certificates, expected 2, got %v", len(cert.Certificate))