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