Rework encode, idiot
This commit is contained in:
@@ -28,11 +28,8 @@ type (
|
||||
|
||||
func (p *PDU_HEADER) Encode() ([]uint8, error) {
|
||||
buf := make([]uint8, 16)
|
||||
binary.BigEndian.PutUint32(buf[0:4], p.command_length)
|
||||
binary.BigEndian.PutUint32(buf[4:8], p.command_id)
|
||||
binary.BigEndian.PutUint32(buf[8:12], p.command_status)
|
||||
binary.BigEndian.PutUint32(buf[12:16], p.sequence_number)
|
||||
return buf, nil
|
||||
err := p.EncodeInto(&buf)
|
||||
return buf, err
|
||||
}
|
||||
func (p *PDU_HEADER) EncodeInto(buf *[]uint8) error {
|
||||
if buf == nil {
|
||||
|
Reference in New Issue
Block a user