nicksnyder / go-i18n

Translate your Go program into multiple languages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expose fields (or add access methods) of MessageNotFoundErr

stephenafamo opened this issue · comments

With errors.As, it is now possible to detect the error, but since the fields are private, there is no way to extract the structured details without resorting to string parsing.

What is your use case for wanting access to the underlying fields?

For now, I am doing structured logging and would prefer to have the language and message key as fields.

In the future, I intend to send custom alerts to ease the translation flow.

Any intention of exposing this? 🙏🏾

I don't have a strong objection. If you want to open a PR I will review it.