github.com/powerman/golang-tools@v0.1.11-0.20220410185822-5ad214d8d803/go/pointer/testdata/extended.go (about) 1 //go:build ignore 2 // +build ignore 3 4 package main 5 6 var a int 7 8 type t struct { 9 a *map[string]chan *int 10 } 11 12 func fn() []t { 13 m := make(map[string]chan *int) 14 m[""] = make(chan *int, 1) 15 m[""] <- &a 16 return []t{t{a: &m}} 17 } 18 19 func main() { 20 x := fn() 21 print(x) // @pointstoquery <-(*x[i].a)[key] command-line-arguments.a 22 }