Is it possible to have an anonymous interface implementation (something
similar to anonymous structs)? In the code below I'd like to have a foo
implementation without declaring a struct.
-------------------------------------------------------------------
package main
type T interface {
Foo()
}
func Bar(t T) {
t.Foo()
}
func main() {
Bar(nil) //need quick foo implementation here without declaring a type and
declaring a method on it
}
--------------------------------------------------------------------
Thanks!
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.