[SOLVED] Int-to-int32 and back: different behavior on different platforms (is it a bug?)

So. Here is the code https://play.golang.org/p/hs-NyoMCVh. This code converts int to uint32 and to []byte using encoding/binary. And back. On the playground it returns -100. But on Linux amd64 I get big positive integer (4294967196). Versions: go1.6 and go1.6.2.

So. This problem is not referenced to encoding/binary
var int l = -100 fmt.Println(int(uint32(l)) // <- this

Solution: https://play.golang.org/p/Td-Hu46wzQ

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.