Creates an in-memory zip of the files provided. Uses archive.CreateZipFromTar under the hood.
(t testing.TB, files map[string]string)
| 53 | // Creates an in-memory zip of the files provided. |
| 54 | // Uses archive.CreateZipFromTar under the hood. |
| 55 | func CreateZip(t testing.TB, files map[string]string) []byte { |
| 56 | ta := CreateTar(t, files) |
| 57 | tr := tar.NewReader(bytes.NewReader(ta)) |
| 58 | za, err := archive.CreateZipFromTar(tr, int64(len(ta))) |
| 59 | require.NoError(t, err) |
| 60 | return za |
| 61 | } |