I need to get the string value of pointer, how can I achieve it?
Something like &a.String()
&a.String()
Use fmt.Sprintf():
fmt.Sprintf()
func main() { i := 42 ip := &i strValue := fmt.Sprintf("%p", &ip) fmt.Println(strValue) }