Remove obsolete code (pkg/count)

This commit is contained in:
Denis Arh
2020-11-30 20:28:45 +01:00
parent 0cd101cdd6
commit 5ecdd94f59
-28
View File
@@ -1,28 +0,0 @@
package count
import (
"bytes"
"io"
)
// Lines provides a line count
//
// https://stackoverflow.com/a/24563853
func Lines(r io.ReadSeeker) (count uint64, err error) {
defer r.Seek(0, 0)
buf := make([]byte, 32*1024)
lineSep := []byte{'\n'}
for {
c, err := r.Read(buf)
count += uint64(bytes.Count(buf[:c], lineSep))
switch {
case err == io.EOF:
return count, nil
case err != nil:
return count, err
}
}
}