Hacker News new | ask | show | jobs
by haiku2077 381 days ago
Just tried this and it appears to be valid in the compiler, formatter and golangci-lint
1 comments

https://en.wikipedia.org/wiki/Yoda_conditions

Works especially well in languages that can make assignments in if statements, e.g:

if foo = 42 { }

Thank you, I was unaware of this label. Quite descriptive.