MCPcopy Create free account
hub / github.com/GoTestTools/gotestfmt / FormatWithConfigAndExitCode

Method FormatWithConfigAndExitCode

gotestfmt.go:98–119  ·  view source on GitHub ↗
(input io.Reader, target io.WriteCloser, cfg renderer.RenderSettings)

Source from the content-addressed store, hash-verified

96}
97
98func (g *goTestFmt) FormatWithConfigAndExitCode(input io.Reader, target io.WriteCloser, cfg renderer.RenderSettings) int {
99 tokenizerOutput := tokenizer.Tokenize(input)
100 prefixes, downloads, packages := parser.Parse(tokenizerOutput)
101 result, exitCodeChan := renderer.RenderWithSettingsAndExitCode(
102 prefixes,
103 downloads,
104 packages,
105 g.downloadsTpl,
106 g.packageTpl,
107 cfg,
108 )
109
110 for {
111 fragment, ok := <-result
112 if !ok {
113 return <-exitCodeChan
114 }
115 if _, err := target.Write(fragment); err != nil {
116 panic(fmt.Errorf("failed to write to output: %w", err))
117 }
118 }
119}

Callers 2

FormatMethod · 0.95
FormatWithConfigMethod · 0.95

Calls 4

TokenizeFunction · 0.92
ParseFunction · 0.92
WriteMethod · 0.45

Tested by

no test coverage detected