MCPcopy Index your code
hub / github.com/coder/coder / main

Function main

scripts/gotestsummary/main.go:67–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67func main() {
68 cfg := config{MarkdownOut: "-", MaxOutputBytes: 8192, FailuresCapBytes: defaultFailuresCapBytes}
69 flags := flag.NewFlagSet(os.Args[0], flag.ExitOnError)
70 flags.StringVar(&cfg.JSONFile, "jsonfile", cfg.JSONFile, "path to go test JSON output")
71 flags.StringVar(&cfg.MarkdownOut, "markdown-out", cfg.MarkdownOut, "path for Markdown output, or - for stdout")
72 flags.StringVar(&cfg.FailuresOut, "failures-out", cfg.FailuresOut, "path for failures NDJSON output")
73 flags.IntVar(&cfg.MaxOutputBytes, "max-output-bytes", cfg.MaxOutputBytes, "maximum output bytes captured per failure")
74 flags.IntVar(&cfg.MaxFailures, "max-failures", cfg.MaxFailures, "maximum failures to render in Markdown, or 0 for all")
75 if err := flags.Parse(os.Args[1:]); err != nil {
76 _, _ = fmt.Fprintln(os.Stderr, err)
77 os.Exit(2)
78 }
79 if err := run(context.Background(), cfg, os.Stdout, os.Stderr, os.Getenv); err != nil {
80 _, _ = fmt.Fprintln(os.Stderr, err)
81 os.Exit(1)
82 }
83}
84
85func run(ctx context.Context, cfg config, stdout, stderr io.Writer, getenv func(string) string) error {
86 if cfg.JSONFile == "" {

Callers

nothing calls this directly

Calls 3

ExitMethod · 0.80
runFunction · 0.70
ParseMethod · 0.65

Tested by

no test coverage detected