On Thu, Apr 28, 2022 at 9:49 AM Glen D souza wrote:
> Consider the following piece of code
>
> type Dog struct {
> }
>
> type Walker interface {
> Walks()
> }
>
> func (d *Dog) Walks() {
>
> }
>
> func CheckWalker(w Walker) {
>
> }
>
> func main() {
> dog := Dog{}
> CheckWalker(dog) -
Consider the following piece of code
type Dog struct {
}
type Walker interface {
Walks()
}
func (d *Dog) Walks() {
}
func CheckWalker(w Walker) {
}
func main() {
dog := Dog{}
CheckWalker(dog) -> cannot use dog (variable of type Dog) as Walker
value in argument to CheckWalker: Do