(packages []string)
| 269 | } |
| 270 | |
| 271 | func 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 | |
| 296 | func GfmrunActionFunc(ctx context.Context, cmd *cli.Command) error { |
| 297 | docsDir := filepath.Join(cmd.String("top-dir"), "docs") |
no outgoing calls