Skip to content

proposal: errors: -  #52380

Closed
Closed
@switchupcb

Description

@switchupcb

_ to ignore the error. - to return error if not nil. ~ to wrap da err.

func bezo(baller, dollers string) error {
    bucko, - := strconv.Atoi(baller)
    bucks, _ := strconv.Atoi(dollers)
    fmt.Println("$:", bucko + bucks)

    return nil
}

Error are values in Go, so don't bother using a keyword or special function for it. Also, this is backwards compatible for the boomers out there.

But what about minus sign. How can we tellll???

It's on the left hand side. Do more leetcode or something. Sure. ? would be fine; it's not the same key as _ though.

But what about handle and defer???

Well, do you handle and defer your other values? N- oh, yeah? You do? Go back to leetcode. Now.

But what about check???

Last time I checked, I didn't use keywords for integers (and other values). Leetcode for even asking that question. You peasant.

But what abou-

image

Other Proposals

The issue with the other proposals is that they don't believe in themselves enough. Too much big words. All that justification. We are GO programmers. Our personal advertisements consist of Lamborghini and McClaren... We don't search Google. Google searches us. Listen up.

I will travel across the land, searching far and wide.
To teach Go devs to understand, the power that's inside.
(Go Errors, Gotta Catch Em All) It's you and me
I know it's my destiny
(Go Errors) Oh, you're my best friend
In programs we must defend
(Go Errors, Gotta Catch Em All) If err not nil
A return will pull us through
You teach me and I'll teach you
Go Errors! (Gotta Catch 'em all) Gotta Catch 'em all (Go Errors!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeLanguageChangeSuggested changes to the Go languageProposalerror-handlingLanguage & library change proposals that are about error handling.v2An incompatible library change

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions