Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/VictoriaMetrics/easyproto

go 1.18
go 1.16
19 changes: 16 additions & 3 deletions writer.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package easyproto

import (
"encoding/binary"
"math"
"math/bits"
"sync"
Expand Down Expand Up @@ -677,11 +676,25 @@ func (f *field) marshal(dst []byte, m *Marshaler) []byte {
}

func marshalUint64(dst []byte, u64 uint64) []byte {
return binary.LittleEndian.AppendUint64(dst, u64)
return append(dst,
byte(u64),
byte(u64>>8),
byte(u64>>16),
byte(u64>>24),
byte(u64>>32),
byte(u64>>40),
byte(u64>>48),
byte(u64>>56),
)
}

func marshalUint32(dst []byte, u32 uint32) []byte {
return binary.LittleEndian.AppendUint32(dst, u32)
return append(dst,
byte(u32),
byte(u32>>8),
byte(u32>>16),
byte(u32>>24),
)
}

func marshalVarUint64(dst []byte, u64 uint64) []byte {
Expand Down