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

Function newContentWriter

pkg/iostreams/iostreams.go:503–508  ·  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

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

Callers 4

StartPagerMethod · 0.85
SystemFunction · 0.85
TestFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFunction · 0.68