Andrew's Digital Garden

Ternaries in Go

Go has no ternaries. If/else is preferred. It's argued that while ternaries are shorter, they are often used to create complex, hard to read code.

https://golang.org/doc/faq#Does_Go_have_a_ternary_form

[[go]]

Ternaries in Go