mc-webserver/utils/io/counting-writer.go
2023-08-13 20:19:47 +01:00

11 lines
169 B
Go

package io
type CountingWriter struct {
Length int64
}
func (c *CountingWriter) Write(p []byte) (n int, err error) {
c.Length += int64(len(p))
return len(p), nil
}