Created
April 15, 2012 21:34
-
-
Save awreece/2394924 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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