MCPcopy Create free account
hub / github.com/cli/cli / writeExportReport

Function writeExportReport

script/ghmock/export.go:176–196  ·  view source on GitHub ↗

writeExportReport writes what each run printed, after its full command and the schema files it checked against.

(w io.Writer, runs []runRecord)

Source from the content-addressed store, hash-verified

174// writeExportReport writes what each run printed, after its full command and
175// the schema files it checked against.
176func writeExportReport(w io.Writer, runs []runRecord) error {
177 for i, run := range runs {
178 if i > 0 {
179 fmt.Fprintln(w)
180 }
181 fmt.Fprintf(w, "### Run %s at %s\n", run.ID, run.Time.UTC().Format(time.RFC3339))
182 fmt.Fprintf(w, "$ %s\n", run.Command)
183 for _, f := range run.Schemas {
184 if f.Error != "" {
185 fmt.Fprintf(w, "%s: not loaded, so not checked: %s\n", f.Name, f.Error)
186 } else {
187 fmt.Fprintf(w, "%s: sha256 %s, %s\n", f.Name, f.SHA256, f.Path)
188 }
189 }
190 fmt.Fprintln(w)
191 if _, err := io.WriteString(w, run.Report); err != nil {
192 return err
193 }
194 }
195 return nil
196}
197
198func exportReadme() string {
199 var b strings.Builder

Callers 1

writeExportDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected