MCPcopy
hub / github.com/urfave/cli / testCleanup

Function testCleanup

scripts/build.go:271–294  ·  view source on GitHub ↗
(packages []string)

Source from the content-addressed store, hash-verified

269}
270
271func testCleanup(packages []string) error {
272 out := &bytes.Buffer{}
273
274 fmt.Fprintf(out, "mode: count\n")
275
276 for _, pkg := range packages {
277 filename := pkg + ".coverprofile"
278
279 lineBytes, err := os.ReadFile(filename)
280 if err != nil {
281 return err
282 }
283
284 lines := strings.Split(string(lineBytes), "\n")
285
286 fmt.Fprint(out, strings.Join(lines[1:], "\n"))
287
288 if err := os.Remove(filename); err != nil {
289 return err
290 }
291 }
292
293 return os.WriteFile("coverage.txt", out.Bytes(), 0o644)
294}
295
296func GfmrunActionFunc(ctx context.Context, cmd *cli.Command) error {
297 docsDir := filepath.Join(cmd.String("top-dir"), "docs")

Callers 1

TestActionFuncFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestActionFuncFunction · 0.68