logoalt Hacker News

haiku207706/03/20251 replyview on HN

Just tried this and it appears to be valid in the compiler, formatter and golangci-lint


Replies

_whiteCaps_06/03/2025

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

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

if foo = 42 { }

show 1 reply