Closed
Description
gopls version
go env
-
What did you do?
Trigger completion at the end of
package pkg
import "fmt"
func foo() {
var longword any
fmt.Printf("%p", lon
What did you see happen?
The line completes to
fmt.Printf("%p", &longword
What did you expect to see?
fmt.Printf("%p", longword
The variable has an interface type. I intended to print the pointer stored in the interface value, not the address of the local variable.
The same happens with maps, channels, unsafe.Pointer, and functions, all of which are accepted by %p
. It does not happen with true pointers, or slices.
Editor and settings
No response
Logs
No response