Skip to content

Instantly share code, notes, and snippets.

@ghais
Created June 11, 2011 18:49
Show Gist options
  • Save ghais/1020838 to your computer and use it in GitHub Desktop.
Save ghais/1020838 to your computer and use it in GitHub Desktop.
example.go
play.go:20: cannot use &b (type *Baz) as type Foo in function argument:
*Baz does not implement Foo (wrong type for FooBar method)
have FooBar(other *Baz)
want FooBar(other Foo)
package main
type Foo interface {
FooBar(other Foo)
}
func Bar(f Foo) {
f.FooBar(f)
}
type Baz struct {}
func (b *Baz) FooBar(other *Baz) {
}
func main() {
var b Baz
Bar(&b)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment