caio.co/de/go-tdigest

More verbose documentation for FromBytes

Id
d14527501a0c8da608063ac644f703c4429afd94
Author
Caio
Commit time
2018-11-10T12:04:32+01:00

Modified serialization.go

@@ -118,8 +118,12
return t, nil
}

-// FromBytes deserializes into the supplied TDigest struct, re-using and
-// overwriting any existing buffers.
+// FromBytes deserializes into the supplied TDigest struct, re-using
+// and overwriting any existing buffers.
+//
+// This method reinitializes the digest from the provided buffer
+// discarding any previously collected data. Notice that in case
+// of errors this may leave the digest in a unusable state.
func (t *TDigest) FromBytes(buf []byte) error {
if len(buf) < 16 {
return errors.New("buffer too small for deserialization")