From 3f973341f7be15d75377708dcea1f7d63a5bae7d Mon Sep 17 00:00:00 2001 From: Trevor Dawe Date: Sun, 1 Dec 2024 19:26:59 +0000 Subject: [PATCH] Fix check for nil or non-nil error --- service/service_unit_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service/service_unit_test.go b/service/service_unit_test.go index 9dc86453..4de758e7 100644 --- a/service/service_unit_test.go +++ b/service/service_unit_test.go @@ -575,7 +575,11 @@ func TestGetZoneKeyLabelFromSecret(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { label, err := getZoneKeyLabelFromSecret(tt.arrays) - assert.Equal(t, err, tt.expectedErr) + if tt.expectedErr == nil { + assert.Nil(t, err) + } else { + assert.NotNil(t, err) + } assert.Equal(t, label, tt.expectedLabel) }) }