github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/addr1.gno (about) 1 package main 2 3 import "fmt" 4 5 type T struct { 6 A int 7 B int 8 } 9 10 func main() { 11 a := &[]T{ 12 {1, 2}, 13 {3, 4}, 14 } 15 fmt.Println("a:", a) 16 x := &(*a)[1:][0] 17 fmt.Println("x:", x) 18 } 19 20 // Output: 21 // a: &[{1 2} {3 4}] 22 // x: &{3 4}