News for hackers. Stuff that matters.
Re:Golang: How to Update APIs for Generics by mseepgood on Thursday September 16, 2021 @07:10AM (#28550250)
Too late, Go already has exceptions since 1.0.
Re:Golang: How to Update APIs for Generics by pjmlp on Thursday September 16, 2021 @07:36AM (#28550420)
Indeeed,

    func ThrowIfError(err error) {
        if err != nil {
            panic(err)
        }
    }
    // ....
    name, err := FuncWithError()
    ThrowIfError(err)