What is the right way to use a global pointer variable in GO?

When I copy and paste the test in the following code, it works in the main method. As stated in the code below, an error is issued

panic: runtime error: invalid memory address or nil pointer dereference

What is the right way to use a global pointer variable in GO?

https://play.golang.org/p/QSN4qR7jia3