# https://www.youtube.com/watch?v=gRpUfjTwSOo&utm_source=golangweekly&utm_medium=email package main import "fmt" type user struct { name string email string } type admin struct { user level string } func(u *user) notify() { fmt.Printf("Sending email to %s<%s>\n", u.name, u.email, ) } type notifier interface { notify() } func main() { foo := user{ name: "Randolf Gorgeous", email: "fake@also.com", } admin := admin{ user: user{ name: "mark platt", email: "fake@fake.com", }, level: "super", } sendNotification(&admin) sendNotification(&foo) } func sendNotification(n notifier) { n.notify() }