Skip to content

proposal: - symbol #52415

Closed
Closed
@switchupcb

Description

@switchupcb

Add an assignment symbol (-) that returns a named variable if it's not it's zero value. This is definitely NOT an error proposal. If you think it is, I know a doctor who can check your eyes for you. For free! Call me, 😉.

The zero value of an error (which is a value) is nil.

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

    return nil
}

The supreme art of war is to subdue the enemy without fighting. Let them handle their errors.
— Sun Tzu

Implications: #52380

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