MCPcopy Create free account
hub / github.com/DOSNetwork/core / readLines

Function readLines

dosnode/dos_restapis.go:163–182  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

161 d.End()
162}
163func readLines(path string) ([]string, error) {
164 file, err := os.Open(path)
165 if err != nil {
166 return nil, err
167 }
168 defer file.Close()
169
170 var lines []string
171 buffer := make([]byte, 20)
172
173 for {
174 bytesread, err := file.Read(buffer)
175
176 if err != nil {
177 break
178 }
179 lines = append(lines, string(buffer[:bytesread]))
180 }
181 return lines, nil
182}
183func (d *DosNode) dkgTest(w http.ResponseWriter, r *http.Request) {
184 groupID := big.NewInt(0)
185 start := -1

Callers 1

dkgTestMethod · 0.85

Calls 2

CloseMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected