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

I believe error handling looks like this:

    package main

    import (
        "github.com/bitfield/script"
    )

    func main() {
         _, err := script.Stdin().Column(1).Freq().First(10).Stdout()
        if err != nil {
            log.Fatal(err)
        }
    }
Errors are "remembered" by the pipeline and can be processed when you get to a sink method.


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

Search: