Skip to content

Instantly share code, notes, and snippets.

@ebfe
Last active October 3, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebfe/2463891 to your computer and use it in GitHub Desktop.
Save ebfe/2463891 to your computer and use it in GitHub Desktop.
gosizes
package main
import (
"fmt"
"unsafe"
)
func main() {
var ptr uintptr
var i int
var u uint
fmt.Printf("%7s = %d\n", "int", unsafe.Sizeof(i))
fmt.Printf("%7s = %d\n", "uint", unsafe.Sizeof(u))
fmt.Printf("%7s = %d\n", "uintptr", unsafe.Sizeof(ptr))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment