A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
perf: remove invalid nil pointer check in Translate function
Sonui5e5551a16fb6
diff --git a/plugin/plugin.go b/plugin/plugin.goindex 61ed0d8f..85286855 100644--- a/plugin/plugin.go+++ b/plugin/plugin.go@@ -219,7 +219,7 @@ func MakeTranslator(key string) Translator {// Translate translates the key to the current language of the contextfunc (t Translator) Translate(ctx *GinContext) string {- if &t == nil || t.Fn == nil {+ if t.Fn == nil {return ""}return t.Fn(ctx)