Skip to content

fix(i18n): wrap error in loader#1202

Open
Haroka-74 wants to merge 1 commit intofloatpane:masterfrom
Haroka-74:fix/issue-1051
Open

fix(i18n): wrap error in loader#1202
Haroka-74 wants to merge 1 commit intofloatpane:masterfrom
Haroka-74:fix/issue-1051

Conversation

@Haroka-74
Copy link
Copy Markdown
Contributor

What?

Replaced the %v verb with %w in i18n/loader.go when returning errors from the embedded loader.

Why?

The current implementation stringifies the underlying err using %v, which breaks the error chain. This prevents callers from inspecting the root cause using errors.Is() or errors.As(). Utilizing double %w (supported in Go 1.20+) ensures both ErrLoadFailed and the original error remain accessible in the error tree.

Closes #1051

@Haroka-74 Haroka-74 requested a review from a team as a code owner April 30, 2026 06:23
@github-actions github-actions Bot added the bug Something isn't working label Apr 30, 2026
Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

lgtm, but @Haroka-74 , please pick up non good first issues too, we try to leave the good first issues for newcomers

@Haroka-74
Copy link
Copy Markdown
Contributor Author

Totally understand.

I’m still relatively new to the Go ecosystem, so I started with some good first issues to get familiar with the codebase and workflow. I’ll focus more on non good first issues going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: fmt.Errorf chain '%w: %v' loses original cause in embedded loader

2 participants