Seems to work fine to me: https://play.golang.org/p/6DmDKQLrzd.

In your snippet, the concrete type doesn't implement the interface,
however. What was the error you got when trying to do apply this to more
complicated code.

Chris

On Tue, Feb 14, 2017 at 12:01 PM, Aaron Wood <aaronjw...@gmail.com> wrote:

> I'm wondering why it's not possible to do something like this
> https://play.golang.org/p/UaRLUvhkgz
>
> If a type implements an interface then why can that type not be returned
> with the method specifying the return type as the interface that it
> implements?
>
> --
> 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 golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to