Refactor /pkg/webhook/v1beta1/pod/inject_webhook_test.go
according to Developer Guide.
#2388
Labels
/pkg/webhook/v1beta1/pod/inject_webhook_test.go
according to Developer Guide.
#2388
What you would like to be added?
Refactor
/pkg/webhook/v1beta1/pod/inject_webhook_test.go
to obey rules defined in the Developer Guide.Why is this needed?
Currently, testcases in
/pkg/webhook/v1beta1/pod/inject_webhook_test.go
are defined in slices and usereflect.Equal
for comparison. It's not recommended according to the Developer Guide. We should:Use cmp.Diff instead of reflect.Equal, to provide useful comparisons.
Define test cases as maps instead of slices to avoid dependencies on the running order. Map key should be equal to the test case name.
Love this feature?
Give it a 👍 We prioritize the features with most 👍
The text was updated successfully, but these errors were encountered: