MCPcopy Create free account
hub / github.com/cli/cli / newContentWriter

Function newContentWriter

pkg/iostreams/iostreams.go:504–509  ·  view source on GitHub ↗

newContentWriter returns the writer to wire up as ContentOut. When sanitize is true it inserts an asciisanitizer in front of the underlying writer; otherwise it returns the underlying writer directly so writes reach stdout unchanged.

(out io.Writer, sanitize bool)

Source from the content-addressed store, hash-verified

502// writer; otherwise it returns the underlying writer directly so writes
503// reach stdout unchanged.
504func newContentWriter(out io.Writer, sanitize bool) io.Writer {
505 if !sanitize {
506 return out
507 }
508 return transform.NewWriter(out, &asciisanitizer.Sanitizer{})
509}
510
511func System() *IOStreams {
512 terminal := ghTerm.FromEnv()

Callers 4

StartPagerMethod · 0.85
SystemFunction · 0.85
TestFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFunction · 0.68