Debian Codegraph @

_test/unsafe2.go

raw symbols SCIP
1 package main
2
3 import (
4 "fmt"
5 "unsafe"
6 )
7
8 func main() {
9 str := "foobar"
10
11 ptr := unsafe.Pointer(&str)
12 p := uintptr(ptr)
13
14 s1 := fmt.Sprintf("%x", ptr)
15 s2 := fmt.Sprintf("%x", p)
16 println(s1 == s2)
17 }
18
19 // Output:
20 // true