I have two ways to get a list.
- via api - which returns me a map[string]interface{}. The value I am interested in is stored in interface as []interface{} (array of strings which are by default set to array of interface)
- via static string - if api fails. This is a comma separated string. I use the strings.Split function which results in an []string
The above results in data of two types []interface{} and []string which is not compatible for the operations an I will have to perform same operation separately based on the type.
Further I am converting the array to a map[string]int with key as string and value as 1. I am converting it to a map for quick checking of some attributes in the original array
Is there any solution to the problem and what is the best way to do it..