Basically, I want to return all rows of a specific value in the query which looks as the following
var listOf []map[string]interface{}
query2 = strings.Replace(query2, "listOfIds", fmt.Sprintf("%v", listOf[0]["itemIds"]), -1)
at the moment the above returns first row as expected since listOf[0] but how can I return all of them, is there a way to do this?
EDIT:
To give a bit more context, there are 2 queries. Query 1 generates the ids which then are being past on query 2
whereQuery := " WHERE ssItemStoreId = itemIds AND ssItemStoreId = clId" + whereVariables + " AND itemClosedReason != 'Duplicated' AND clId != '' AND ItemArchived = 0"
query1 = query1 + whereQuery
//Data Variables
var listOf []map[string]interface{}
The results are being passed on s.makeSqlQuery(query1, &listOf) which are being passed on query 2 but there are hundreds of rows and I am only retriving one. I tried using range but I get index out of range [0] with length 0
query2 = strings.Replace(query2, "listOfIds", fmt.Sprintf("%v", listOf[0]["itemIds"]), -1)
Thank you!