Skip to content

Fix #70: Use %w formatting directives when fmt.Error'ing an error. #71

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

constantoine
Copy link

@constantoine constantoine commented Jun 4, 2025

As explained in #70, not using %w formatting directive in some places makes it non-trivial for the user to make use of the error in a meaningful way (errors.Is or errors.As), outside of string matching. This is particularly painful for errors returned by custom type's XXXUnmarshaler

This PR aims to change the remaining fmt.Errorf calls where %w directive isn't used but an error is passed while adding no new code.

@constantoine constantoine requested a review from a team as a code owner June 4, 2025 12:38
@constantoine
Copy link
Author

Hi @jamietanna I hope the ping is not inappropriate :)

Do those changes (as well as the rationale behind them) sound acceptable to you?

@jamietanna
Copy link
Member

jamietanna commented Jun 17, 2025

Pings are not recommended 😅

I have seen this and I do agree with it, thanks for fixing it!

I hadn't got round to replying here, and would like to merge this alongside some other runtime changes, but my focus recently has been trying to get oapi-codegen itself ready for a release, which is slow work 🙃

Will try to get to this soon!

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