This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 5e5551a16fb67e92ba8fed3c32432123bc81319f
Author: Sonui <[email protected]>
AuthorDate: Wed Aug 7 22:51:23 2024 +0800

    perf: remove invalid nil pointer check in Translate function
---
 plugin/plugin.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugin/plugin.go b/plugin/plugin.go
index 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 context
 func (t Translator) Translate(ctx *GinContext) string {
-       if &t == nil || t.Fn == nil {
+       if t.Fn == nil {
                return ""
        }
        return t.Fn(ctx)

Reply via email to