func ThrowIfError(err error) { if err != nil { panic(err) } } // .... name, err := FuncWithError() ThrowIfError(err)
Reply on news.ycombinator.com