Skip to content

Instantly share code, notes, and snippets.

@awreece
Created April 15, 2012 21:34
Show Gist options
  • Save awreece/2394924 to your computer and use it in GitHub Desktop.
Save awreece/2394924 to your computer and use it in GitHub Desktop.
func ptr2uintptr(ptr []byte) uintptr {
return uintptr(unsafe.Pointer(ptr)) // cannot convert ptr (type []byte) to type unsafe.Pointer
/*
if bp, e := strconv.ParseInt(fmt.Sprintf("%p", ptr), 0, 32); e != nil {
log.Fatal(e)
} else {
return uintptr(bp)
}
panic("unreachable")
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment