Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tchssk
Copy link
Member

@tchssk tchssk commented Jul 6, 2025

Related to #3541

@tchssk tchssk requested a review from Copilot July 6, 2025 06:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors error checks to use errors.Is() for better reliability when comparing wrapped errors.

  • Replaced direct err == comparisons with errors.Is(err, ...) across payload decode functions, templates, client SSE code, and example clients.
  • Updated template files and golden examples to reflect these changes.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
http/codegen/testdata/payload_decode_functions.go Swapped err == ... with errors.Is(err, ...)
http/codegen/templates/request_decoder.go.tpl Updated EOF checks to use errors.Is
http/codegen/templates/partial/request_elements.go.tpl Updated cookie error check to use errors.Is
http/codegen/templates/client_sse.go.tpl Swapped SSE error checks to use errors.Is
codegen/example/testdata/*.golden Updated flag error checks to use errors.Is
codegen/example/templates/client_endpoint_init.go.tpl Updated flag error check to use errors.Is

@tchssk tchssk marked this pull request as ready for review July 6, 2025 06:43
@raphael
Copy link
Member

raphael commented Jul 6, 2025

Thank you!

@raphael raphael merged commit 528dfdb into v3 Jul 6, 2025
9 checks passed
@raphael raphael deleted the errors-is-2 branch July 6, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants