rsapi/commands.go
func buildQuery(values []APIParams) (APIParams, error) {
	query := APIParams{}
	for _, value := range values {
		// Only one iteration below, flatten params only have one element each
		for name, param := range value {
			if q, ok := query[name]; ok {
				if a, ok := q.([]interface{}); ok {
					query[name] = append(a, param)
				} else {
					query[name] = []interface{}{q, param}
				}
			} else {
				query[name] = param
			}
		}
	}
	return query, nil
}
func buildQuery(values []APIParams) (APIParams, error) {
	query := APIParams{}
	for _, value := range values {
		// Only one iteration below, flatten params only have one element each
		for name, param := range value {
			if q, ok := query[name]; ok {
				if a, ok := q.([]interface{}); ok {
					query[name] = append(a, param)
				} else {
					query[name] = []interface{}{q, param}
				}
			} else {
				query[name] = param
			}
		}
	}
	return query, nil
}
// Reconstruct query from flatten values