From 8a4af1634fdae8fd5b4283955740081ff6a8bbc0 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 09:21:29 +0100 Subject: [PATCH] ax(ueps): replace non-standard errorA/errorB with idiomatic err MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AX Principle 1 — predictable names over short/non-standard names. errorA and errorB are not ecosystem-standard; err is the correct name for error variables. Each call now checks err immediately after capture, matching the established Go and Core convention. Co-Authored-By: Charon --- pkg/ueps/packet_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/ueps/packet_test.go b/pkg/ueps/packet_test.go index c8d235e..23dff71 100644 --- a/pkg/ueps/packet_test.go +++ b/pkg/ueps/packet_test.go @@ -106,12 +106,16 @@ func TestPacket_MarshalAndSign_Good(t *testing.T) { func TestPacket_MarshalAndSign_Bad(t *testing.T) { builder := NewBuilder(0x02, []byte("data")) - frame1, errorA := builder.MarshalAndSign([]byte("secret-a")) - frame2, errorB := builder.MarshalAndSign([]byte("secret-b")) - - if errorA != nil || errorB != nil { - t.Fatalf("MarshalAndSign errors: %v, %v", errorA, errorB) + frame1, err := builder.MarshalAndSign([]byte("secret-a")) + if err != nil { + t.Fatalf("MarshalAndSign(secret-a) failed: %v", err) } + + frame2, err := builder.MarshalAndSign([]byte("secret-b")) + if err != nil { + t.Fatalf("MarshalAndSign(secret-b) failed: %v", err) + } + if bytes.Equal(frame1, frame2) { t.Error("expected different frames for different secrets, got identical frames") }