Complete the code to declare a pointer to a struct variable.
var p [1] PersonIn Go, a pointer to a struct is declared using the * symbol before the struct type.
Complete the code to assign the address of a struct variable to a pointer.
p = [1]personUse the & operator to get the address of a variable in Go.
Fix the error in accessing a struct field through a pointer.
fmt.Println(p[1]Name)In Go, you access struct fields through a pointer using the dot . operator directly; Go automatically dereferences the pointer.
Fill both blanks to create a pointer to a struct and assign it.
p := [1]Person[2]
Use & to get the address of a struct literal Person{}.
Fill all three blanks to create a map with struct pointers and filter by a field.
result := map[string]*Person{ [1]: [2]Person{Name: "Alice"} }
filtered := map[string]*Person{}
for k, v := range result {
if v.Name [3] "Alice" {
filtered[k] = v
}
}Use a key string "user1", get the address of the struct with &, and compare the field with ==.