diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2020-01-27 19:14:44 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2020-01-27 19:14:44 -0500 |
commit | 496fca7357463f6ca05acab688018e8a1dc11855 (patch) | |
tree | a82fe9486961ff594d24550d09a72e1bf3eca569 /rrdformat/rrdbinary/types.go | |
parent | b6957681707ffec34df5132c45194e4589120e26 (diff) |
rrdbinary: Switch to a interface-based incremental decoder
Diffstat (limited to 'rrdformat/rrdbinary/types.go')
-rw-r--r-- | rrdformat/rrdbinary/types.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rrdformat/rrdbinary/types.go b/rrdformat/rrdbinary/types.go index 006af3c..0bf4913 100644 --- a/rrdformat/rrdbinary/types.go +++ b/rrdformat/rrdbinary/types.go @@ -31,3 +31,13 @@ type EOF struct{} // 0 bytes func (u Unival) AsUint64() uint64 { return uint64(u) } func (u Unival) AsFloat64() float64 { return math.Float64frombits(uint64(u)) } + +// Statically assert that each of the above types implements the +// 'unmarshaler' interface. +var _ unmarshaler = func() *String { return nil }() +var _ unmarshaler = func() *Float { return nil }() +var _ unmarshaler = func() *Uint { return nil }() +var _ unmarshaler = func() *Int { return nil }() +var _ unmarshaler = func() *Unival { return nil }() +var _ unmarshaler = func() *Time { return nil }() +var _ unmarshaler = func() *EOF { return nil }() |