refactor: Decompose syscalls into pkg, start adding utility commands
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package readers
|
||||
|
||||
import "io"
|
||||
|
||||
type Counter struct {
|
||||
Reader io.Reader
|
||||
|
||||
BytesRead int
|
||||
}
|
||||
|
||||
func (r *Counter) Read(p []byte) (n int, err error) {
|
||||
n, err = r.Reader.Read(p)
|
||||
|
||||
r.BytesRead += n
|
||||
|
||||
return n, err
|
||||
}
|
||||
Reference in New Issue
Block a user