>> Sure, convert to a string and use that as a map key.
:-) no, no, no. it looks very very ugly.

четверг, 16 марта 2023 г. в 00:26:35 UTC+3, Ian Lance Taylor: 

> On Wed, Mar 15, 2023 at 2:16 PM alex-coder <a.gus...@gmail.com> wrote:
> >
> > Ian, thank you.
> > but may be the is any workaround ?
> > Use as a key not directly but like a derived from those 
> interface/structure types ?
> > Of course I may declare key like string and use switch + .(type) to 
> mimic it.
>
> Sure, convert to a string and use that as a map key.
>
> By the way, I should say that although you can't use `ast.Field` as a
> map key type, you can use `*ast.Field`. Of course then two different
> Field values that happen to look exactly the same will get different
> map entries. So it kind of depends on what you want to do.
>
> Ian
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f0556fc4-885a-4f13-a29e-1894983e5962n%40googlegroups.com.

Reply via email to