Hi,
I have an interface{} variable that can be either string or a list of
string (yes, that's bad design, I know).
I need a []string to feed it to strings.Join (I need one string for output).
This way works, that is explicitly creating []string and copying each
element to it:
var list []string
for _, v := range mail.([]interface{}) {
list = append(list, v.(string))
}
rcpt = strings.Join(list, ", ")
Have I overlooked something and there is a way to do it in a more graceful
and effective way?
Thanks.
--
Vasily Korytov
https://chillum.github.io
--
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/d/optout.