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 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ workflows:
name: 'test_go_<< matrix.go_version >>'
matrix:
parameters:
go_version: ['1.13', '1.14', '1.15', '1.16', '1.17']
go_version: ['1.15', '1.16', '1.17']

jobs:
test:
Expand Down
16 changes: 16 additions & 0 deletions client/v2/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,19 @@ func (client *Client) GetRawMsgpack(ctx context.Context, response interface{}, p
func (client *Client) Post(ctx context.Context, response interface{}, path string, body interface{}, headers []*Header) error {
return client.submitForm(ctx, response, path, body, "POST", true /* encodeJSON */, headers)
}

// Helper function for correctly formatting and escaping URL path parameters.
// Used in the generated API client code.
func EscapeParams(params ...interface{}) []interface{} {
paramsStr := make([]interface{}, len(params))
for i, param := range params {
switch v := param.(type) {
case string:
paramsStr[i] = url.PathEscape(v)
default:
paramsStr[i] = fmt.Sprintf("%v", v)
}
}

return paramsStr
}