Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A notable use of this pattern is bufio.Scanner: http://golang.org/pkg/bufio/#Scanner

An example, scanning lines from standard input:

    s := bufio.NewScanner(os.Stdin)
    for s.Scan() {
        fmt.Println(s.Text()) 
    }
    if err := s.Err(); err != nil {
        fmt.Fprintln(os.Stderr, "reading standard input:", err)
    }


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: