From 0ab8c0fe7d216865674ea1c3174a6c028ffa5fa8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 10:39:30 +0100 Subject: [PATCH] ax(ueps): remove redundant err shadow in ReadAndVerify payload branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inner scope re-declared `var err error` immediately before assigning from `io.ReadAll`, unnecessarily shadowing the `err` already in scope from `reader.ReadByte()`. Removing the shadow simplifies the control flow and eliminates the redundant declaration (AX Principle 1 — names should not introduce unnecessary cognitive overhead). Co-Authored-By: Charon --- pkg/ueps/reader.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/ueps/reader.go b/pkg/ueps/reader.go index 73b4bd3..52fb932 100644 --- a/pkg/ueps/reader.go +++ b/pkg/ueps/reader.go @@ -39,7 +39,6 @@ func ReadAndVerify(reader *bufio.Reader, sharedSecret []byte) (*ParsedPacket, er } if tagByte == TagPayload { - var err error payload, err = io.ReadAll(reader) if err != nil { return nil, err