Refer this Pull Request on github,I found a possible solution to get the parameters like a[]=1&a[]=2:

Code in golang:
// Return an array
a, _ := ctx.GetQueryArray("a[]") // Or just use QueryArray("a[]") directly.
ctx.JSON(200, gin.H{
"a[]": a,
})
Parameters like &b[0]=1&b[1]=2, You could use QueryMap directly(This wouldn't return an array,though):

// Return a map.
ctx.JSON(200, gin.H{
"b": ctx.QueryMap("b"),
})
I don't think there is a direct way to get an array with map.I did some changes from the source code of get in gin.Context(hardcode):
var dicts []map[string]string
key := "a"
queryMap := ctx.Request.URL.Query()
//log.Println(dicts) // dicts[0] except
for k, v := range queryMap {
if i:= strings.IndexByte(k, '['); i >= 1 && k[0:i] == key{
if j := strings.IndexByte(k[i+1:], ']'); j >= 1{
index, _ := strconv.Atoi(k[i+1: i+j+1]) // get the index of slice
if index > len(dicts){
ctx.JSON(200, gin.H{
"403": "Check your data",
})
return
}
if index == len(dicts){
tmp := make(map[string]string)
dicts = append(dicts, tmp)
}
pre :=strings.IndexByte(k[i+j+2:], '[')
last:=strings.IndexByte(k[i+j+2:], ']')
dicts[index][k[i+j+3+pre: i+j+2+last]] = v[0]
}
}
}
ctx.JSON(200, gin.H{
"a": dicts,
})
Example:
When data out of bounds:
