ax(ueps): replace variable placeholder with concrete value in writeTLV usage comment

AX Principle 2 requires comments to show concrete usage with realistic values.
The writeTLV comment used `intentID` (a variable name) as a placeholder
rather than a real value; replaced with `0x01` and added error-capture
pattern to show the full call site shape.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 13:07:53 +01:00
parent e08d475c13
commit 00d0e5ed96
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -104,8 +104,8 @@ func (builder *PacketBuilder) MarshalAndSign(sharedSecret []byte) ([]byte, error
return frameBuffer.Bytes(), nil
}
// writeTLV(frameBuffer, TagVersion, []byte{0x09})
// writeTLV(frameBuffer, TagIntent, []byte{intentID})
// if err := writeTLV(buffer, TagVersion, []byte{0x09}); err != nil { return nil, err }
// if err := writeTLV(buffer, TagIntent, []byte{0x01}); err != nil { return nil, err }
func writeTLV(writer io.Writer, tagType uint8, tagValue []byte) error {
// writeTLV(writer, TagVersion, bytes.Repeat([]byte("x"), 256)) → errTLVValueTooLarge
if len(tagValue) > 255 {