MCPcopy
hub / github.com/chrislusf/glow / testSaveToFile

Function testSaveToFile

examples/word_count/word_count.go:230–243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

228}
229
230func testSaveToFile() {
231 flow.New().TextFile(
232 "/etc/passwd", 3,
233 ).Map(func(line string, ch chan string) {
234 for _, token := range strings.Split(line, ":") {
235 ch <- token
236 }
237 }).Sort(func(a string, b string) bool {
238 if strings.Compare(strings.ToLower(a), strings.ToLower(b)) < 0 {
239 return true
240 }
241 return false
242 }).SaveTextToFile("test7.output")
243}

Callers 1

mainFunction · 0.85

Calls 4

SaveTextToFileMethod · 0.80
SortMethod · 0.80
MapMethod · 0.80
TextFileMethod · 0.80

Tested by

no test coverage detected