func (lz *Lz4) CheckExt(filename string) error {
	if filepath.Ext(filename) != ".lz4" {
		return fmt.Errorf("filename must have a .lz4 extension")
	}
	return nil
}
CheckExt ensures the file extension matches the format.
package archiver
import (
	"fmt"
	"io"
	"path/filepath"
	"github.com/pierrec/lz4"
)
type Lz4 struct {
	CompressionLevel int
}
func (lz *Lz4) Compress(in io.Reader, out io.Writer) error {
	w := lz4.NewWriter(out)
	w.Header.CompressionLevel = lz.CompressionLevel
	defer w.Close()
	_, err := io.Copy(w, in)
	return err
}
func (lz *Lz4) Decompress(in io.Reader, out io.Writer) error {
	r := lz4.NewReader(in)
	_, err := io.Copy(out, r)
	return err
}