X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/d2810ae9038b057e8f18e8b495a57d8f96ae5be6..b365559d0b92cbd2193d72365d32baa62c62a98e:/hotline/transaction.go diff --git a/hotline/transaction.go b/hotline/transaction.go index 04fb4b6..e7bfa58 100644 --- a/hotline/transaction.go +++ b/hotline/transaction.go @@ -214,7 +214,7 @@ func ReadFields(paramCount []byte, buf []byte) ([]Field, error) { return fields, nil } -func (t Transaction) MarshalBinary() (data []byte, err error) { +func (t *Transaction) MarshalBinary() (data []byte, err error) { payloadSize := t.Size() fieldCount := make([]byte, 2) @@ -238,7 +238,7 @@ func (t Transaction) MarshalBinary() (data []byte, err error) { } // Size returns the total size of the transaction payload -func (t Transaction) Size() []byte { +func (t *Transaction) Size() []byte { bs := make([]byte, 4) fieldSize := 0 @@ -251,7 +251,7 @@ func (t Transaction) Size() []byte { return bs } -func (t Transaction) GetField(id int) Field { +func (t *Transaction) GetField(id int) Field { for _, field := range t.Fields { if id == int(binary.BigEndian.Uint16(field.ID)) { return field