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