ax(ueps): rename tagByte to tagType in writeTLV for semantic clarity

tagByte described the storage representation; tagType names the semantic
role (the T in TLV = Type-Length-Value), matching AX Principle 1.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 10:52:23 +01:00
parent ba9da9444c
commit a8b2dad8ec
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

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