cityuni-webserver/utils/io/counting-writer.go

11 lines
169 B
Go
Raw Permalink Normal View History

2022-07-16 11:47:52 +01:00
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
}