MCPcopy Index your code
hub / github.com/minio/mc / String

Method String

cmd/admin-config-get.go:75–96  ·  view source on GitHub ↗

String colorized service status message.

()

Source from the content-addressed store, hash-verified

73
74// String colorized service status message.
75func (u configGetMessage) String() string {
76 console.SetColor("EnvVar", color.New(color.FgYellow))
77 bio := bufio.NewReader(bytes.NewReader(u.value))
78 var lines []string
79 for {
80 s, e := bio.ReadString('\n')
81 // Make lines displaying environment variables bold.
82 if strings.HasPrefix(s, "# MINIO_") {
83 s = strings.TrimPrefix(s, "# ")
84 parts := strings.SplitN(s, "=", 2)
85 s = fmt.Sprintf("# %s=%s", console.Colorize("EnvVar", parts[0]), parts[1])
86 lines = append(lines, s)
87 } else {
88 lines = append(lines, s)
89 }
90 if e == io.EOF {
91 break
92 }
93 fatalIf(probe.NewError(e), "Unable to marshal to string.")
94 }
95 return strings.Join(lines, "")
96}
97
98// JSON jsonified service status Message message.
99func (u configGetMessage) JSON() string {

Callers

nothing calls this directly

Calls 3

NewErrorFunction · 0.92
fatalIfFunction · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected