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

Method ColorCountString

pkg/statistor.go:142–155  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140}
141
142func (stat *Statistor) ColorCountString() string {
143 if len(stat.Counts) == 0 {
144 return ""
145 }
146 var s strings.Builder
147 s.WriteString(fmt.Sprintf("[stat] %s ", stat.BaseUrl))
148 for k, v := range stat.Counts {
149 if k == 0 {
150 continue
151 }
152 s.WriteString(fmt.Sprintf(" %s: %s,", logs.Cyan(strconv.Itoa(k)), logs.YellowBold(strconv.Itoa(v))))
153 }
154 return s.String()
155}
156
157func (stat *Statistor) ColorSourceString() string {
158 if len(stat.Sources) == 0 {

Callers 1

PrintStatMethod · 0.80

Calls 1

StringMethod · 0.95

Tested by

no test coverage detected