Complete the code to declare an interface named Speaker.
type Speaker interface { [1]() string }The interface method name should be Speak to define a Speaker interface.
Complete the code to implement the Speaker interface for type Person.
func (p Person) [1]() string { return "Hello" }
The method Speak matches the interface method and implements Speaker.
Fix the error in the code to assign a Person to a Speaker variable.
var s Speaker = [1]Only a value of type Person that implements Speaker can be assigned to s.
Fill both blanks to create a function that accepts any Speaker and calls Speak.
func greet(s [1]) string { return s.[2]() }
The function parameter type should be Speaker and call the Speak method.
Fill all three blanks to create a map of Speakers and call Speak on each.
speakers := map[string][1]{ "alice": [2]{}, } for name, sp := range speakers { println(name, sp.[3]()) }
The map holds values of interface type Speaker. The value is a Person struct. The method called is Speak.
