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

generator-go-sdk: should return http repsonse in listOperationTemplate #4128

Closed
wuxu92 opened this issue May 10, 2024 · 0 comments · Fixed by #4129
Closed

generator-go-sdk: should return http repsonse in listOperationTemplate #4128

wuxu92 opened this issue May 10, 2024 · 0 comments · Fixed by #4129
Labels
area/pagination Related to Listing/Pagination enhancement New feature or request tool/generator-go-sdk Issues with the Go SDK Generator

Comments

@wuxu92
Copy link
Collaborator

wuxu92 commented May 10, 2024

The HTTP response should be stored in the LatestHttpResponse field, even if an error occurs. This means that the code lines below should be moved before the error check at L341. By doing this, the caller can check the HTTP status code instead of the error string.\

result = %[2]sCompleteResult{
LatestHttpResponse: resp.HttpResponse,
Items: items,
}

resp, err := c.%[2]s(ctx%[6]s)
if err != nil {
err = fmt.Errorf("loading results: %%+v", err)
return
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/pagination Related to Listing/Pagination enhancement New feature or request tool/generator-go-sdk Issues with the Go SDK Generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants