var someInterfaceValue interface{} switch { case someInterfaceValue: // proposal: compile error: non-bool used as condition case someInterfaceValue == true: // OK }
Sometimes carefulness is just not enough. One may type a wrong variable as the case condition, or a incomplete condition. Why is this special? Because it's commonly used. -- 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.