From 9dea4d6ac4daf8daddb018e4f63aeacd9ef92fca Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 09:05:29 +0100 Subject: [PATCH] ax(ueps): replace errors.Is usage examples with direct sentinel comparison AX Principle 2 requires comments to show correct usage patterns. errMissingHMAC and errIntegrityViolation are tlvError sentinels (comparable values), so the examples should use == not errors.Is from the banned errors package. Co-Authored-By: Charon --- pkg/ueps/reader.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/ueps/reader.go b/pkg/ueps/reader.go index ce21406..d3a3aeb 100644 --- a/pkg/ueps/reader.go +++ b/pkg/ueps/reader.go @@ -10,11 +10,11 @@ import ( ) // packet, err := ReadAndVerify(bufio.NewReader(conn), secret) -// if errors.Is(err, errMissingHMAC) { /* no HMAC tag found in frame */ } +// if err == errMissingHMAC { /* no HMAC tag found in frame */ } var errMissingHMAC = tlvError("UEPS packet missing HMAC signature") // packet, err := ReadAndVerify(bufio.NewReader(conn), wrongSecret) -// if errors.Is(err, errIntegrityViolation) { /* HMAC mismatch — threat score incremented */ } +// if err == errIntegrityViolation { /* HMAC mismatch — threat score incremented */ } var errIntegrityViolation = tlvError("integrity violation: HMAC mismatch (ThreatScore +100)") // packet, err := ueps.ReadAndVerify(bufio.NewReader(conn), sharedSecret)