Complete the code to define a method with a pointer receiver.
func (p [1]) Greet() string { return "Hello, " + p.name }
The method receiver must be a pointer type *Person to modify the original struct.
Complete the code to call the method with a pointer receiver correctly.
p := Person{name: "Alice"}
result := p.[1]()Go automatically handles calling pointer receiver methods on value variables, so just use p.Greet().
Fix the error in the method receiver declaration.
func ([1] Person) UpdateName(newName string) {
p.name = newName
}The receiver variable name should be an identifier like p, not a type.
Fill both blanks to define a method with a pointer receiver and update the struct field.
func ([1] [2]) UpdateAge(newAge int) { p.age = newAge }
The receiver variable is p and the receiver type is a pointer *Person to modify the original struct.
Fill all three blanks to create a method with a value receiver that returns the person's name in uppercase.
func ([1] [2]) NameUpper() string { return strings.[3](p.name) }
ToLower instead of ToUpper.The receiver variable is p, the receiver type is Person (value receiver), and the function to convert to uppercase is ToUpper from the strings package.