diff --git a/utils/limited_writer.go b/utils/limited_writer.go index 72090e0de..15c6a9c29 100644 --- a/utils/limited_writer.go +++ b/utils/limited_writer.go @@ -1,4 +1,4 @@ -// Copyright 2020 Northern.tech AS +// Copyright 2023 Northern.tech AS // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -60,26 +60,3 @@ func (lw *LimitedWriteCloser) Close() error { } return lw.W.Close() } - -// ByteCountWriteCloser - as the name implies, just counts how many bytes the -// Writer/WriteCloser interface has written. -type ByteCountWriteCloser struct { - BytesWritten uint64 - wc io.WriteCloser -} - -func NewByteCountWriteCloser(wc io.WriteCloser) *ByteCountWriteCloser { - return &ByteCountWriteCloser{wc: wc} -} - -// Write - Writer/WriteCloser interface function -func (bcwc *ByteCountWriteCloser) Write(p []byte) (int, error) { - n, err := bcwc.wc.Write(p) - bcwc.BytesWritten += uint64(n) - return n, err -} - -// Close - WriteCloser interface function -func (bcwc *ByteCountWriteCloser) Close() error { - return bcwc.wc.Close() -}