You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The try just check the last function return parameters is error type ,if that err value is not nil, return the parent function with that error value at that line and do not run code after that line.
Let's allow a semicolon before short inlined if-return to cleanup error handling code - like this:
Nowdays gofmt replaces the code like this:
Pros:
Cons:
This issue is related to: #27135 and also error handling design of GO2 (I have already posted some feedback in https://gist.github.com/jozef-slezak/93a7d9d3d18d3fce3f8c3990c031f8d0 but I think we should consider this simple and readable gofmt change even in GO1).
The text was updated successfully, but these errors were encountered: