8000 simplify the go code · Issue #64396 · golang/go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

simplify the go code #64396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wiltchamberian opened this issue Nov 27, 2023 · 1 comment
Closed

simplify the go code #64396

wiltchamberian opened this issue Nov 27, 2023 · 1 comment

Comments

@wiltchamberian
Copy link

Proposal Details

as there is no exception primary like "try, catch" in go, the error processing code becomes tendious, why not add a new key word like "reif" (return if) , it performs like:
reif handleProcess();
which is equivalent to err:=handleProcess(); if (err!=nil) return

@ksw2000
Copy link
ksw2000 commented Nov 27, 2023

The current Golang can do it concisely.

if err := handleProcess(); err != nil {
    return
}

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
@golang golang locked and limited conversation to collaborators Nov 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants
0