News for hackers. Stuff that matters.
Re:Toward Go 1.3 by azernik on Tuesday February 11, 2014 @08:06PM (#7221811)
Errors in Go are custom types; your error can be defined as, for example:

    type URLError {
        url String
    }

    func (e URLError) Error() String {
        return fmt.Sprintf("Invalid URL: %s", e.url)
    }
At which point a caller that wants to handle this error can either extract the URL to do fun things with it or just dump the Error() string.

There are no comments on this comment yet.