Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
macintux
9 months ago
|
parent
|
context
|
favorite
| on:
(On | No) Syntactic Support for Error Handling
I know diddly/squat about Go, but from similar patterns in aeons past, would "nil == err" work as a way to make it stand out?
haiku2077
9 months ago
|
next
[–]
Just tried this and it appears to be valid in the compiler, formatter and golangci-lint
_whiteCaps_
9 months ago
|
parent
|
next
[–]
https://en.wikipedia.org/wiki/Yoda_conditions
Works especially well in languages that can make assignments in if statements, e.g:
if foo = 42 { }
macintux
9 months ago
|
root
|
parent
|
next
[–]
Thank you, I was unaware of this label. Quite descriptive.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: