I have a requirement where user can pass multiple values to a key under an array. i want the app to run the validation for each value in the array and print the response accordingly.
i want the tickets [abc, def, ghi] to be passed as input variable to a third party api with get method and print the received response one another below.
My current implementation accepts only single value for key “ticket” and gives out the response. Now i want the value for key to be multiple array and return the desired response for each value.
you can use a Map to relate your ticket with the response.
I mean take the snowapiresp vakue and store in a map, say
m = make(map[string]*Response)
key := fmt.Sprintf(SnowInc + SnowTicket)
m[key] = nil
// process the url and when you got snowapiresp store in your map
m[key] = snowapiresp
Thanks Yamil actually the requirement is based on the ticket type the calls should be selected whether to use INC search or CHG search and print the response of both the tickets one below the other