MCPcopy Index your code
hub / github.com/cli/cli / createZipArchive

Function createZipArchive

pkg/cmd/run/view/logs_test.go:526–542  ·  view source on GitHub ↗
(t *testing.T, files map[string]string)

Source from the content-addressed store, hash-verified

524}
525
526func createZipArchive(t *testing.T, files map[string]string) []byte {
527 buf := bytes.NewBuffer(nil)
528 zw := zip.NewWriter(buf)
529
530 for name, content := range files {
531 fileWriter, err := zw.Create(name)
532 assert.NoError(t, err)
533
534 _, err = fileWriter.Write([]byte(content))
535 assert.NoError(t, err)
536 }
537
538 err := zw.Close()
539 assert.NoError(t, err)
540
541 return buf.Bytes()
542}

Callers 3

TestViewRunFunction · 0.85
TestRunLogFunction · 0.85
createZipReaderFunction · 0.85

Calls 3

CreateMethod · 0.65
WriteMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected