From eafd673d13fb86fc4b49f8c9e2723cb72aa713ab Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 09:26:11 +0100 Subject: [PATCH] ax(ueps): replace abbreviated buf with buffer in writeTLV usage example comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AX Principle 1 — predictable names over short names. Test comments showing writeTLV usage had buf (abbreviated) while the actual code used buffer (descriptive). Comments are usage examples that agents learn from; the name must match what an agent would write. Co-Authored-By: Charon --- pkg/ueps/packet_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/ueps/packet_test.go b/pkg/ueps/packet_test.go index 23dff71..2260bd8 100644 --- a/pkg/ueps/packet_test.go +++ b/pkg/ueps/packet_test.go @@ -145,8 +145,8 @@ func TestPacket_MarshalAndSign_Ugly(t *testing.T) { } } -// writeTLV(buf, TagVersion, []byte{0x09}) -// // buf contains: [0x01, 0x01, 0x09] +// writeTLV(buffer, TagVersion, []byte{0x09}) +// // buffer contains: [0x01, 0x01, 0x09] func TestPacket_writeTLV_Good(t *testing.T) { buffer := new(bytes.Buffer) @@ -170,7 +170,7 @@ func TestPacket_writeTLV_Good(t *testing.T) { } } -// writeTLV(buf, TagPayload, bytes.Repeat([]byte("x"), 256)) +// writeTLV(buffer, TagPayload, bytes.Repeat([]byte("x"), 256)) // // returns error: "TLV value too large for 1-byte length header" func TestPacket_writeTLV_Bad(t *testing.T) { buffer := new(bytes.Buffer) @@ -183,8 +183,8 @@ func TestPacket_writeTLV_Bad(t *testing.T) { } } -// writeTLV(buf, TagIntent, []byte{}) -// // buf contains: [0x04, 0x00] (tag + zero length, no value bytes) +// writeTLV(buffer, TagIntent, []byte{}) +// // buffer contains: [0x04, 0x00] (tag + zero length, no value bytes) func TestPacket_writeTLV_Ugly(t *testing.T) { buffer := new(bytes.Buffer)