MCPcopy Index your code
hub / github.com/coder/coder / CreateZip

Function CreateZip

testutil/archive.go:55–61  ·  view source on GitHub ↗

Creates an in-memory zip of the files provided. Uses archive.CreateZipFromTar under the hood.

(t testing.TB, files map[string]string)

Source from the content-addressed store, hash-verified

53// Creates an in-memory zip of the files provided.
54// Uses archive.CreateZipFromTar under the hood.
55func 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}

Calls 2

CreateZipFromTarFunction · 0.92
CreateTarFunction · 0.85