Re: [go-nuts] Explain the meaning of iota

2017-07-03 Thread Bartosz Grzybowski
Was looking for this for some time, great explanation, thanks ! W dniu niedziela, 2 lipca 2017 23:37:51 UTC+2 użytkownik Sam Whited napisał: > > On Sun, Jul 2, 2017 at 4:34 PM, Sam Whited > wrote: > > This means that the code you pasted is the same as if you'd written: >

Re: [go-nuts] Explain the meaning of iota

2017-07-02 Thread Sam Whited
On Sun, Jul 2, 2017 at 4:34 PM, Sam Whited wrote: > This means that the code you pasted is the same as if you'd written: > > type ByteSize float64 > > const ( > _ = 0 // ignore first value by assigning to blank identifier > KB ByteSize = 1 <<

Re: [go-nuts] Explain the meaning of iota

2017-07-02 Thread Sam Whited
On Fri, Jun 30, 2017 at 10:23 PM, Manohar Reddy wrote: > `iota` is golnag's enum. I've seen this code in Wikipedia. But I did not > understand it. Can someone please explain this code? This is slightly nitpicky since many languages don't use enums for much more than what

Re: [go-nuts] Explain the meaning of iota

2017-06-30 Thread Shawn Milochik
https://github.com/golang/go/wiki/Iota -- 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

[go-nuts] Explain the meaning of iota

2017-06-30 Thread Manohar Reddy
`iota` is golnag's enum. I've seen this code in Wikipedia. But I did not understand it. Can someone please explain this code? type ByteSize float64 const ( _ = iota // ignore first value by assigning to blank identifier KB ByteSize = 1 << (10 * iota) MB GB) -- You