Hi rob Thanks for your response. I didn't know that trick, but it seems to me a little bit ugly to guard fields that way. I will stick to named initialisations and write it as a policy into the style guide.
Cheers Am Donnerstag, 6. Juli 2017 02:26:27 UTC+2 schrieb rob rodgers: > > for some of our sensitive structures that are tricky and have multiple > fields of the same type, there is a trick you can use: > > type bar struct { > A int > _ bool > } > > see https://play.golang.org/p/rFKGoKq-S9 > > > -- 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.