3 ms·
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?
by macintux 1y ago
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 1y agoJust tried this and it appears to be valid in the compiler, formatter and golangci-lint
- _whiteCaps_ 1y agohttps://en.wikipedia.org/wiki/Yoda_conditions 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 1y agoThank you, I was unaware of this label. Quite descriptive.
- deleted 1y ago[deleted]