Skip to content

Instantly share code, notes, and snippets.

@krancour
Created March 11, 2019 15:04
Show Gist options
  • Save krancour/ed9d05bc4ecbc31fc8ce063356d2353f to your computer and use it in GitHub Desktop.
Save krancour/ed9d05bc4ecbc31fc8ce063356d2353f to your computer and use it in GitHub Desktop.
func main() {
// The type of the greeter variable is the Greeter interface; NOT the
// EnglishGreeter type that implements it
var greeter Greeter = &EnglishGreeter{}
// The next line doesn't care what implementation of Greeter is used
greeter.SayGreeting()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment