Multiple query parameters in URL


(Kumar Saurabh) #1

can anyone help me to convert the multiple query parameters in URL
i.e.

abc.com?convert=USD&id=1&id=2&id=3 

to

abc.com?convert=USD&id=1,2,3 

The value ID is []int and coming from a struct ,for example

type ABC struct {
ID []int `url:"id"`
} 

and I am using “github.com/google/go-querystring/query” for encoding and querrying.


(Madan) #2

I have written one-liner converter for you, see here https://play.golang.org/p/21547Wv9Qv2