On Wed, Mar 15, 2023 at 2:16 PM alex-coder <a.gusse...@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/CAOyqgcUi%2BVpBSumSRQueJwC7BVCJCbsCtPE%2B-q_gcU3wPDf4mw%40mail.gmail.com.

Reply via email to