func main() { http.HandleFunc("/", Helper(func() <-chan string { pipe := unix.Ls() return unix.Grep(pipe, "test") })) http.ListenAndServe("localhost:8080", nil) }
func main() { out := unix.Ls() for { line, ok := <-out if !ok { break } fmt.Println(line) } }