ax(ueps): replace non-standard errorA/errorB with idiomatic err
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled

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 <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 09:21:29 +01:00
parent 6010f02091
commit 8a4af1634f
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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")
}