Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ func (c *Client) SetHeaders(h map[string]string) *Client {

// Param returns all values of the specified query parameter.
func (c *Client) Param(key string) []string {
res := []string{}
tmp := c.params.PeekMulti(key)
res := make([]string, 0, len(tmp))
for _, v := range tmp {
res = append(res, utils.UnsafeString(v))
}
Expand Down
4 changes: 2 additions & 2 deletions client/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func (r *Request) SetHeaders(h map[string]string) *Request {

// Param returns all values associated with the given query parameter.
func (r *Request) Param(key string) []string {
var res []string
tmp := r.params.PeekMulti(key)
res := make([]string, 0, len(tmp))
for _, v := range tmp {
res = append(res, utils.UnsafeString(v))
}
Expand Down Expand Up @@ -447,8 +447,8 @@ func (r *Request) resetBody(t bodyType) {

// FormData returns all values associated with a form field.
func (r *Request) FormData(key string) []string {
var res []string
tmp := r.formData.PeekMulti(key)
res := make([]string, 0, len(tmp))
for _, v := range tmp {
res = append(res, utils.UnsafeString(v))
}
Expand Down
Loading