Skip to content

Instantly share code, notes, and snippets.

@mkock
Created October 2, 2021 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkock/22698a09ce4e9f8b4901913b2b45fc17 to your computer and use it in GitHub Desktop.
Save mkock/22698a09ce4e9f8b4901913b2b45fc17 to your computer and use it in GitHub Desktop.
// University is defined in package schools
type University struct {
school.School
}
func (u University) Name() string { return "Copenhagen Highschool" }
func (u University) Location() string { return "Copenhagen City Center" }
// func (u University) students() []string { return []string{"George", "Ben", "Louise", "Calvin"} } // Can't redefine.
var _ school.School = University{} // Works!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment