MCPcopy Index your code
hub / github.com/coder/coder / String

Method String

cli/cliui/log.go:20–33  ·  view source on GitHub ↗

String formats the CLI message for consumption by a human.

()

Source from the content-addressed store, hash-verified

18
19// String formats the CLI message for consumption by a human.
20func (m cliMessage) String() string {
21 var str strings.Builder
22
23 if m.Prefix != "" {
24 _, _ = str.WriteString(Bold(m.Prefix))
25 }
26
27 pretty.Fprint(&str, m.Style, m.Header)
28 _, _ = str.WriteString("\r\n")
29 for _, line := range m.Lines {
30 _, _ = fmt.Fprintf(&str, " %s %s\r\n", pretty.Sprint(m.Style, "|"), line)
31 }
32 return str.String()
33}
34
35// Warn writes a log to the writer provided.
36func Warn(wtr io.Writer, header string, lines ...string) {

Callers 15

WarnMatchedProvisionersFunction · 0.45
TestExternalAuthFunction · 0.45
TestPeerDiagnosticsFunction · 0.45
promptJSONFunction · 0.45
DisplayTableFunction · 0.45
renderTableFunction · 0.45
typeToTableHeadersFunction · 0.45
valueToTableMapFunction · 0.45
WarnFunction · 0.45
InfoFunction · 0.45
ErrorFunction · 0.45

Calls 2

BoldFunction · 0.85
WriteStringMethod · 0.80

Tested by 7

TestExternalAuthFunction · 0.36
TestPeerDiagnosticsFunction · 0.36
Test_OutputFormatterFunction · 0.36
TestBuilderFunction · 0.36
TestCommandHelpFunction · 0.36