Skip to content

Instantly share code, notes, and snippets.

@preslavmihaylov
Last active June 18, 2020 13:23
// package decls, imports...
// Hooman & Pet interfaces...
// Person & Dog structs...
func PlayAround(type H Hooman, P Pet)(human H, pet P) {
fmt.Println("The human says:", human.Speak())
fmt.Println("And the pet responds:", pet.ProduceSound())
}
func main() {
PlayAround(Person{}, Dog{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment