FYI I recently posted a proposal for some unambiguous syntax which would give a lot of the value of ternary operators i.e. write the 5 line if-else block in the FAQ as a 1-liner, without the drawbacks, while IMO preserving the simplicity of the go language in approachability, readability and orthogonality.
Please review http://golang.org/issue/31659 and share your thoughts. On Wednesday, April 24, 2019 at 8:05:07 AM UTC-4, Mark Volkmann wrote: > > > > On Apr 24, 2019, at 6:22 AM, Robert Engels <ren...@ix.netcom.com > <javascript:>> wrote: > > > > Though to the ops point, not sure why Go doesn’t have the ternary > operator - which is pretty ubiquitous. > > The idea of adding the ternary operator to Go has been debated many times. > It’s clear that those in charge have a strong dislike for it. For me the > lack of the ternary operator is one of main things I dislike about Go. It’s > nails on a chalkboard for me to write a five line “if” statement when it > could have been a one line assignment statement. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.