On Wednesday, September 14, 2016 at 3:47:29 PM UTC+2, Chris Hines wrote: > > On Monday, September 12, 2016 at 8:57:15 AM UTC-4, Markus Zimmermann wrote: >> >> Hi gophers! >> >> I am wondering why we have a "declared and not used" compile error for >> variables [https://play.golang.org/p/KLzHVO5L7q] but not for constants [ >> https://play.golang.org/p/JG9dSa_VKg]? I am sure there is some rational >> decision behind this that I have missed, but my Google-fu is just not >> strong enough to find an answer. >> >> Cheers, >> Markus >> > > It may be a stretch, but allowing unused constants may be desirable when > we're using iota and we don't want higher constants to change when some of > the intermediate values become unused. >
No reason to keep an unused constant for that. You can use the blank identifier https://play.golang.org/p/A55mWz_c93 -- 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.