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

Method String

pkg/iostreams/untrusted.go:38–44  ·  view source on GitHub ↗

String returns the content with ANSI escape sequences neutralized. It is called automatically by the fmt package, so printing an Untrusted value is safe by default on every fmt path.

()

Source from the content-addressed store, hash-verified

36// called automatically by the fmt package, so printing an Untrusted value is
37// safe by default on every fmt path.
38func (u Untrusted) String() string {
39 sanitized, _, err := transform.String(&asciisanitizer.Sanitizer{}, u.raw)
40 if err != nil {
41 return stripControl(u.raw)
42 }
43 return sanitized
44}
45
46// Raw returns the unsanitized content. It is the explicit, greppable opt-out
47// for non-terminal uses (hashing, writing to disk, piping). Never pass the

Callers 2

viewRunFunction · 0.95

Calls 2

stripControlFunction · 0.85
StringMethod · 0.65

Tested by 1