packageingestimport"io"// countingWriter counts bytes written to dst.typecountingWriterstruct{dstio.Writernint}// Write writes src to dst and tracks output byte count.func(writer*countingWriter)Write(src[]byte)(int,error){n,err:=writer.dst.Write(src)writer.n+=nreturnn,err}