(c interface{}, name, folder string, format plugin.OutputFormat, zipper *zip.Writer)
| 113 | } |
| 114 | |
| 115 | func addContentToZip(c interface{}, name, folder string, format plugin.OutputFormat, zipper *zip.Writer) error { |
| 116 | var writer io.Writer |
| 117 | fileName := filepath.Join(folder, name) + "." + string(format) |
| 118 | writer, err := zipper.Create(fileName) |
| 119 | if err != nil { |
| 120 | return fmt.Errorf("could not add '%s' to zip: %w", fileName, err) |
| 121 | } |
| 122 | |
| 123 | if err = plugin.Print(c, format, writer); err != nil { |
| 124 | return fmt.Errorf("could not print '%s': %w", fileName, err) |
| 125 | } |
| 126 | return nil |
| 127 | } |
| 128 | |
| 129 | func addObjectsToZip(objects []namedObject, folder string, format plugin.OutputFormat, zipper *zip.Writer) error { |
| 130 | for _, obj := range objects { |
no test coverage detected