Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #1782

Merged
merged 1 commit into from
Apr 12, 2024
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5

- run: |
go build ./...
7 changes: 5 additions & 2 deletions option/requestoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ func WithResponseInto(dst **http.Response) RequestOption {
}
}

// WithRequestBody returns a RequestOption that provides a custom serialized body with content type.
// WithRequestBody returns a RequestOption that provides a custom serialized body with the given
// content type.
//
// body accepts an io.Reader or raw []bytes.
func WithRequestBody(contentType string, body any) RequestOption {
return func(r *requestconfig.RequestConfig) error {
if reader, ok := body.(io.Reader); ok {
Expand All @@ -204,7 +207,7 @@ func WithRequestBody(contentType string, body any) RequestOption {
return r.Apply(WithHeader("Content-Type", contentType))
}

return fmt.Errorf("body is must either be a byte slice or implement io.Reader")
return fmt.Errorf("body must be a byte slice or implement io.Reader")
}
}

Expand Down