ax(ueps): rename buf→buffer in usage example comments
Abbreviated names in comments teach agents bad patterns. AX Principle 1 applies to usage examples too. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
b18aa741ba
commit
e65057e8af
1 changed files with 3 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ import (
|
|||
"io"
|
||||
)
|
||||
|
||||
// writeTLV(buf, TagPayload, oversized) → errTLVValueTooLarge
|
||||
// writeTLV(buffer, TagPayload, oversized) → errTLVValueTooLarge
|
||||
// if errors.Is(err, errTLVValueTooLarge) { /* value exceeded 255-byte TLV length limit */ }
|
||||
var errTLVValueTooLarge = tlvError("TLV value too large for 1-byte length header")
|
||||
|
||||
|
|
@ -107,8 +107,8 @@ func (builder *PacketBuilder) MarshalAndSign(sharedSecret []byte) ([]byte, error
|
|||
return buffer.Bytes(), nil
|
||||
}
|
||||
|
||||
// writeTLV(buf, TagVersion, []byte{0x09})
|
||||
// writeTLV(buf, TagIntent, []byte{intentID})
|
||||
// writeTLV(buffer, TagVersion, []byte{0x09})
|
||||
// writeTLV(buffer, TagIntent, []byte{intentID})
|
||||
func writeTLV(writer io.Writer, tag uint8, value []byte) error {
|
||||
// Check strict length constraint (1 byte length = max 255 bytes)
|
||||
if len(value) > 255 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue