Preliminary debug state

This commit is contained in:
9seconds
2018-07-06 17:29:24 +03:00
parent 88faeb7195
commit a3933e6ede
21 changed files with 127 additions and 57 deletions
+20
View File
@@ -0,0 +1,20 @@
package utils
import "io"
const readCurrentDataBufferSize = 1024 + 1
func ReadCurrentData(src io.Reader) (rv []byte, err error) {
buf := make([]byte, readCurrentDataBufferSize)
n := readCurrentDataBufferSize
for n == len(buf) {
n, err = src.Read(buf)
if err != nil {
return nil, err
}
rv = append(rv, buf[:n]...)
}
return rv, nil
}