My test code:
tmp64 := int64(128)
tmp64 = tmp64 << 56
fmt.Println("int64:128<<56 = ", tmp64)
utmp64 := uint64(128)
utmp64 = utmp64 << 56
fmt.Println("uint64:128<<56 = ", utmp64)
tmp32 := int32(128)
tmp32 = tmp32 << 24
fmt.Println("int32:128<<24 = ", tmp32)
utmp32 := uint32(128)
utmp32 = utmp32 << 24
fmt.Println("int32:128<<24 = ", utmp32)
Strange and wrong output for int64/uint64 but all right for int32/uint32. The output as following:
int64:128<<56 = -9223372036854775808
uint64:128<<56 = 9223372036854775808
int32:128<<24 = -2147483648
int32:128<<24 = 2147483648
Both of Win7, go1.6.2 and SUSE 11, go1.7 has the same issue.