[Go] Method
// User
type User struct {
ID int
FirstName string
}
// Method
func (u *User) describe() string {
desc := fmt.Sprintf("Name %s", u.FirstName)
return desc
}
// Order:
// 0 1 2 defer panic: NOT 2
func main() {
user := User{FirstName: "JK", ID: 1}
fmt.Println(user.describe())
}
describe() is a prop method on User struct