MCPcopy Create free account
hub / github.com/chainreactors/spray / ColorSourceString

Method ColorSourceString

pkg/statistor.go:157–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155}
156
157func (stat *Statistor) ColorSourceString() string {
158 if len(stat.Sources) == 0 {
159 return ""
160 }
161 var s strings.Builder
162 s.WriteString(fmt.Sprintf("[stat] %s ", stat.BaseUrl))
163 for k, v := range stat.Sources {
164 s.WriteString(fmt.Sprintf(" %s: %s,", logs.Cyan(k.Name()), logs.YellowBold(strconv.Itoa(v))))
165 }
166 return s.String()
167}
168
169func (stat *Statistor) Json() string {
170 content, err := json.Marshal(stat)

Callers 1

PrintStatMethod · 0.80

Calls 1

StringMethod · 0.95

Tested by

no test coverage detected