Hi,Chris!
You can try this:
https://play.golang.org/p/KG4nE2nPvnN
tmp2 = []Useable{tmpType(1),tmpType(2)}


On Thu, Feb 1, 2018 at 1:37 AM, Chris Hopkins <cbehopk...@gmail.com> wrote:

> Hi
> Sharing my ignorance:
> I didn't realise that although you can switch-case on an interface, an
> array of interfaces doesn't work.
> https://play.golang.org/p/tD8msjCXyuZ
>
> Any ideas on how to cope with this? I tried:
> _, ok = tmp.([]Useable)
>
> But that fails for the same reason. I can't work out how to detect if the
> type (of the empty interface) is an array of a type that satisfies the
> (useful) interface.
> This must be a common problem and PEBKAC surely?
>
> Regards
>
> Chris
>
> --
> 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.
>



-- 


*Regards,Linker linlinker.m....@gmail.com <linker.m....@gmail.com>*

-- 
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