`MarshalWithEncoder` method always of value
This commit is contained in:
parent
e6a5806188
commit
6706f747d4
|
@ -94,7 +94,7 @@ func (mx *Message) MarshalBinary() ([]byte, error) {
|
|||
return buf, nil
|
||||
}
|
||||
|
||||
func (mx *Message) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
func (mx Message) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
out, err := mx.MarshalBinary()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -78,7 +78,7 @@ func (inst *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) error {
|
|||
return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef)
|
||||
}
|
||||
|
||||
func (inst *Instruction) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
func (inst Instruction) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
return encoder.Encode(inst.Impl)
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ func (i *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) {
|
|||
return i.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionDefVariant)
|
||||
}
|
||||
|
||||
func (i *Instruction) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
func (i Instruction) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
err := encoder.WriteUint8(i.Version)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to write instruction version: %w", err)
|
||||
|
|
|
@ -86,7 +86,7 @@ func (q *RequestQueue) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) {
|
|||
}
|
||||
|
||||
// TODO: fill up later
|
||||
func (q *RequestQueue) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
func (q RequestQueue) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -241,7 +241,7 @@ func (q *EventQueue) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) {
|
|||
}
|
||||
|
||||
// TODO: fill up later
|
||||
func (q *EventQueue) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
func (q EventQueue) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ func (s *Slab) UnmarshalWithDecoder(decoder *bin.Decoder) error {
|
|||
return s.BaseVariant.UnmarshalBinaryVariant(decoder, SlabFactoryImplDef)
|
||||
}
|
||||
|
||||
func (s *Slab) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
func (s Slab) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
err := encoder.WriteUint32(s.TypeID.Uint32(), binary.LittleEndian)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -190,7 +190,7 @@ func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error
|
|||
return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef)
|
||||
}
|
||||
|
||||
func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error {
|
||||
func (inst Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error {
|
||||
err := encoder.WriteUint32(inst.TypeID.Uint32(), binary.LittleEndian)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to write variant type: %w", err)
|
||||
|
|
|
@ -330,7 +330,7 @@ func (inst *Instruction) UnmarshalWithDecoder(decoder *ag_binary.Decoder) error
|
|||
return inst.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionImplDef)
|
||||
}
|
||||
|
||||
func (inst *Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error {
|
||||
func (inst Instruction) MarshalWithEncoder(encoder *ag_binary.Encoder) error {
|
||||
err := encoder.WriteUint8(inst.TypeID.Uint8())
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to write variant type: %w", err)
|
||||
|
|
|
@ -114,7 +114,7 @@ func (i *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) (err error) {
|
|||
return i.BaseVariant.UnmarshalBinaryVariant(decoder, InstructionDefVariant)
|
||||
}
|
||||
|
||||
func (i *Instruction) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
func (i Instruction) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
err := encoder.WriteUint32(i.TypeID.Uint32(), binary.LittleEndian)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to write variant type: %w", err)
|
||||
|
|
|
@ -347,7 +347,7 @@ func (tx *Transaction) MarshalBinary() ([]byte, error) {
|
|||
return output, nil
|
||||
}
|
||||
|
||||
func (tx *Transaction) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
func (tx Transaction) MarshalWithEncoder(encoder *bin.Encoder) error {
|
||||
out, err := tx.MarshalBinary()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue