package main

import "fmt"

type User struct {
	Name string
	Age  int
}

// section: user
func (u User) Greet() {
	fmt.Printf("Hello, %s\n", u.Name)
}

// section: user

type Admin struct {
	User
	Permissions map[string]bool
}

// section: main
func main() {
	a := Admin{
		User: User{
			Name: "Homer",
		},
	}

	// Promoted Method from User type
	a.Greet() // Hello, Homer

	// Promoted fields from User Type
	fmt.Println(a.Name, a.Age)
}

// section: main
