为什么数组的&(地址)在行中打印“&”

Here is the go code

package main 

func main() {

    var ax [2]int
    ax[0] = 22
    ax[1] = 99

    bx := ax
    cx := &ax

    fmt.Println(ax)
    fmt.Println(bx)
    fmt.Println(cx)
    fmt.Printf("%p
", cx)

}

When I execute it, it gives me the following output

PS C:\personal\gospace> ./bin/test
[22 99]
[22 99]
&[22 99]
0xc0420381d0

cx := &ax rightly interpreted cx as pointer. But when I print cx it prints &[22 99] and when I print &ax[0] or %p formatter for cx it rightly prints the address. Why is this behavior?

Default printing verb fmt.Println uses is %v. While printing it differentiates value vs pointer value, that's why you see & in front of cx.

fmt.Println(cx)

Next, you specifically tell fmt.Printf to use the verb %p, refer to printing section and it prints base 16 notation, with leading 0x.

fmt.Printf("%p
", cx)