Go version
1.24 (playground)
Output of go env in your module/workspace:
What did you do?
package main
import (
"fmt"
"unsafe"
)
var y func() string = func() string {
return "sag"
}
func main() {
println(y)
fmt.Printf("%p\n", y)
fmt.Printf("%x", (uintptr)(unsafe.Pointer(&y)))
}
See: https://go.dev/play/p/7K6KJ7TMWXJ
What did you see happen?
0x4be390 <=====
0x492b60 <===== should be the same
559f20
What did you expect to see?
I expected println and fmt.Printf("%p"...) produce the same result.
Go version
1.24 (playground)
Output of
go envin your module/workspace:What did you do?
See: https://go.dev/play/p/7K6KJ7TMWXJ
What did you see happen?
What did you expect to see?
I expected
printlnandfmt.Printf("%p"...)produce the same result.