From ed568f81bf66ccecd264026c60208482d7680300 Mon Sep 17 00:00:00 2001 From: Elara6331 Date: Wed, 21 Feb 2024 22:55:17 -0800 Subject: [PATCH] Don't try to dereference values before calling methods --- salix.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/salix.go b/salix.go index 18ac3f6..19156b2 100644 --- a/salix.go +++ b/salix.go @@ -484,9 +484,6 @@ func (t *Template) execMethodCall(mc ast.MethodCall, local map[string]any) (any, if !rval.IsValid() { return nil, ast.PosError(mc, "%s: cannot call method on nil value", valueToString(mc)) } - for rval.Kind() == reflect.Pointer { - rval = rval.Elem() - } // First, check for a method with the given name mtd := rval.MethodByName(mc.Name.Value) if mtd.IsValid() {