MCPcopy
hub / github.com/go-task/task / WrapWriter

Method WrapWriter

internal/output/group.go:15–29  ·  view source on GitHub ↗
(stdOut, _ io.Writer, _ string, cache *templater.Cache)

Source from the content-addressed store, hash-verified

13}
14
15func (g Group) WrapWriter(stdOut, _ io.Writer, _ string, cache *templater.Cache) (io.Writer, io.Writer, CloseFunc) {
16 gw := &groupWriter{writer: stdOut}
17 if g.Begin != "" {
18 gw.begin = templater.Replace(g.Begin, cache) + "\n"
19 }
20 if g.End != "" {
21 gw.end = templater.Replace(g.End, cache) + "\n"
22 }
23 return gw, gw, func(err error) error {
24 if g.ErrorOnly && err == nil {
25 return nil
26 }
27 return gw.close()
28 }
29}
30
31type groupWriter struct {
32 writer io.Writer

Callers

nothing calls this directly

Calls 2

closeMethod · 0.95
ReplaceFunction · 0.92

Tested by

no test coverage detected