MCPcopy Create free account
hub / github.com/dgraph-io/dgraph-benchmarks / processFile

Function processFile

twitterdata/postprocess/postprocess.go:131–152  ·  view source on GitHub ↗
(path string, work chan<- string)

Source from the content-addressed store, hash-verified

129}
130
131func processFile(path string, work chan<- string) error {
132 fmt.Println("processing", path)
133
134 fd, err := os.Open(path)
135 if err != nil {
136 fmt.Println("error in processing file ::", err)
137 return err
138 }
139 defer fd.Close()
140
141 scanner := bufio.NewScanner(fd)
142 for scanner.Scan() {
143 work <- scanner.Text()
144 }
145
146 if err := scanner.Err(); err != nil {
147 fmt.Println("error in reading file ::", err)
148 return err
149 }
150
151 return nil
152}
153
154func doWork(id int, c *y.Closer, work <-chan string, outDir string) {
155 defer c.Done()

Callers 1

mainFunction · 0.85

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected