I can write a normal gzip file:
var b bytes.Buffer
w := gzip.NewWriter(&b)
w.Write([]byte("hello, world
"))
w.Close()
But I cannot figure out how to mock a gzip file so that I can read that mocked file for my tests:
afero.WriteFile(mfs, "/path/to/file.gz", []byte("here is file"), 0644)
If I try to read this mock gzip file the error I get is:
gzip: invalid header