Created
June 25, 2017 11:54
-
-
Save zgrge/957e77c76adfd8b1ab54117ae019af52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "unsafe" | |
func main() { | |
var x uint32 = 0x01020304 | |
switch *(*byte)(unsafe.Pointer(&x)) { | |
case 0x01: | |
println("Big Endian") | |
case 0x04: | |
println("Little Endian") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment