set mtime of output based on input content
1 file changed, 27 insertions(+), 0 deletions(-)
changed files
A internal/multifile/compress.go
@@ -0,0 +1,27 @@ +package multifile + +import ( + "errors" + "io" + "os" +) + +type CompressWriter struct { + *os.File + Writer io.WriteCloser +} + +func NewCompressWriter(file *os.File, writer io.WriteCloser) *CompressWriter { + return &CompressWriter{ + File: file, + Writer: writer, + } +} + +func (cw *CompressWriter) Write(p []byte) (n int, err error) { + return cw.Writer.Write(p) +} + +func (cw *CompressWriter) Close() error { + return errors.Join(cw.Writer.Close(), cw.File.Close()) +}