Code Review
/
govpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix encoding for float64 and generate conversion for Timestamp
[govpp.git]
/
codec
/
codec.go
diff --git
a/codec/codec.go
b/codec/codec.go
index
3ae578b
..
21354a1
100644
(file)
--- a/
codec/codec.go
+++ b/
codec/codec.go
@@
-156,12
+156,12
@@
func (b *Buffer) DecodeInt64() int64 {
}
func (b *Buffer) EncodeFloat64(v float64) {
}
func (b *Buffer) EncodeFloat64(v float64) {
- binary.
Big
Endian.PutUint64(b.buf[b.pos:b.pos+8], math.Float64bits(v))
+ binary.
Little
Endian.PutUint64(b.buf[b.pos:b.pos+8], math.Float64bits(v))
b.pos += 8
}
func (b *Buffer) DecodeFloat64() float64 {
b.pos += 8
}
func (b *Buffer) DecodeFloat64() float64 {
- v := math.Float64frombits(binary.
Big
Endian.Uint64(b.buf[b.pos : b.pos+8]))
+ v := math.Float64frombits(binary.
Little
Endian.Uint64(b.buf[b.pos : b.pos+8]))
b.pos += 8
return v
}
b.pos += 8
return v
}