From e7219a155f57dee734dcaa2d6f3cd4bd2e4e63bf Mon Sep 17 00:00:00 2001 From: Jake Sanders Date: Tue, 4 May 2021 14:21:38 +0100 Subject: [PATCH] gosimple: S1004 Signed-off-by: Jake Sanders --- pkg/internal/apis/acme/validation/order.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/internal/apis/acme/validation/order.go b/pkg/internal/apis/acme/validation/order.go index d87606a1d..bce8e4c40 100644 --- a/pkg/internal/apis/acme/validation/order.go +++ b/pkg/internal/apis/acme/validation/order.go @@ -42,7 +42,7 @@ func ValidateOrderUpdate(_ *admissionv1.AdmissionRequest, oldObj, newObj runtime func ValidateOrderSpecUpdate(old, new cmacme.OrderSpec, fldPath *field.Path) field.ErrorList { el := field.ErrorList{} - if len(old.Request) > 0 && bytes.Compare(old.Request, new.Request) != 0 { + if len(old.Request) > 0 && !bytes.Equal(old.Request, new.Request) { el = append(el, field.Forbidden(fldPath.Child("request"), "field is immutable once set")) } return el @@ -59,7 +59,7 @@ func ValidateOrderStatusUpdate(old, new cmacme.OrderStatus, fldPath *field.Path) el = append(el, field.Forbidden(fldPath.Child("finalizeURL"), "field is immutable once set")) } // once the Certificate has been issued, it cannot be changed - if len(old.Certificate) > 0 && bytes.Compare(old.Certificate, new.Certificate) != 0 { + if len(old.Certificate) > 0 && !bytes.Equal(old.Certificate, new.Certificate) { el = append(el, field.Forbidden(fldPath.Child("certificate"), "field is immutable once set")) }