proposal: Go 2: When dealing with err, add a wildcard #50207
Labels
error-handling
Language & library change proposals that are about error handling.
FrozenDueToAge
LanguageChange
Suggested changes to the Go language
Proposal
Milestone
can change it to
~ = fun()
相当于如果
~
的类型为error
,并且A()
的返回值为error
,并且~
不为nil
,这自动转换为return errpkg.Wrap(err)
Equivalent to if the type of
~
iserror
, and the return value ofA()
iserror
, and~
is notnil
, this is automatically converted toreturn errpkg Wrap(err)
for example
The text was updated successfully, but these errors were encountered: