From 0afdfdeb2fbd39a9760e01e80d297df87b2457a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Soko=C5=82owski?= Date: Tue, 8 Feb 2022 17:55:33 +0100 Subject: [PATCH] Fix copying user functions (#366) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix copying user functions Fixes #365 * remove EncodingId Co-authored-by: Józef Sokołowski --- objects.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/objects.go b/objects.go index 30913db..2574558 100644 --- a/objects.go +++ b/objects.go @@ -1577,9 +1577,8 @@ func (o *Undefined) Value() Object { // UserFunction represents a user function. type UserFunction struct { ObjectImpl - Name string - Value CallableFunc - EncodingID string + Name string + Value CallableFunc } // TypeName returns the name of the type. @@ -1593,7 +1592,7 @@ func (o *UserFunction) String() string { // Copy returns a copy of the type. func (o *UserFunction) Copy() Object { - return &UserFunction{Value: o.Value} + return &UserFunction{Value: o.Value, Name: o.Name} } // Equals returns true if the value of the type is equal to the value of