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

Function ReadStatistors

pkg/statistor.go:177–193  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

175}
176
177func ReadStatistors(filename string) (Statistors, error) {
178 content, err := ioutil.ReadFile(filename)
179 if err != nil {
180 return nil, err
181 }
182 var stats Statistors
183 for _, line := range bytes.Split(bytes.TrimSpace(content), []byte("\n")) {
184 var stat Statistor
185 err := json.Unmarshal(line, &stat)
186 if err != nil {
187 return nil, err
188 }
189 stats = append(stats, &stat)
190 }
191
192 return stats, nil
193}
194
195type Statistors []*Statistor

Callers 1

BuildTasksMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected