Apparently in your code the value is being assigned to an int. But it’s too large for an int; it needs a uint64 to hold it.
Andy > On Dec 5, 2018, at 8:35 AM, Michel Levieux <m.levi...@capitaldata.fr> wrote: > > Hi guys, > > With a colleague of mine, we've run into a strange issue today. When we look > at package math, in const.go, we can see this line : > > MaxUint64 = 1<<64 - 1 > > which I assume works pretty well. But if I do the same in a test main and try > to 'go run' it, with this line : > > const v = 1 << 64 - 1 > > I get the following error : > > ./testmain.go:8:13: constant 18446744073709551615 overflows int > > I think this is not a bug and we're just missing something here. Could anyone > explain this behaviour / point me to a documentation that explains it? > > Thank you guys > > -- > 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 > <mailto:golang-nuts+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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.