You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we define a custom TemplateParser with some Option, the option has no effect.
Example:
bundle:=NewBundle(language.English)
bundle.AddMessages(language.English, {ID: "Foo", Other: "Foo {{.bar}}!"}...)
conf:=&LocalizeConfig{
MessageID: "Foo",
TemplateData: map[string]string{}, // empty dataTemplateParser: &template.TextParser{Option: "missingkey=error"}, // I want an error if `bar` is not in data
}
localizer:=NewLocalizer(bundle, []string{"en"})
s, err:= localizer.Localize(conf)) // I expect an error here
This is because the .Option() is not used in TextParser.
The text was updated successfully, but these errors were encountered:
If we define a custom TemplateParser with some Option, the option has no effect.
Example:
This is because the
.Option()
is not used in TextParser.The text was updated successfully, but these errors were encountered: