From cca70c691067373b853306c885be56ddae1aef5e Mon Sep 17 00:00:00 2001 From: Siva Date: Wed, 6 Feb 2019 17:31:33 +0530 Subject: [PATCH] [Golang] bugfix #2517 (#2558) --- golang/src/function_test.go | 2 +- golang/src/ndarray.go | 8 ++++---- golang/src/value.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/golang/src/function_test.go b/golang/src/function_test.go index d538228372205..b91503f0f645a 100644 --- a/golang/src/function_test.go +++ b/golang/src/function_test.go @@ -204,7 +204,7 @@ func TestFunctionClosureArg(t *testing.T) { return } if ret1.AsInt64() != ret.AsInt64() { - err = fmt.Errorf("Invoke with int64 didn't match with Value\n") + err = fmt.Errorf("Invoke with int64 didn't match with Value") return } retVal = ret diff --git a/golang/src/ndarray.go b/golang/src/ndarray.go index ceae7e58c203b..409cf86e6e87a 100644 --- a/golang/src/ndarray.go +++ b/golang/src/ndarray.go @@ -101,7 +101,7 @@ func (parray Array) CopyFrom(val interface{}) (err error) { datalen = len(sliceVal) * int(dtype.bits / 8) return parray.nativeCopyFrom(data, datalen) default: - err = fmt.Errorf("Given type not supported : %v\n", reflect.TypeOf(val)) + err = fmt.Errorf("Given type not supported : %v", reflect.TypeOf(val)) return } return @@ -195,7 +195,7 @@ func (parray Array) AsSlice() (retVal interface{}, err error) { err = parray.nativeCopyTo(data, datalen) retVal = sliceVal default: - err = fmt.Errorf("Given type not supported : %v\n", parray.GetDType()) + err = fmt.Errorf("Given type not supported : %v", parray.GetDType()) return } return @@ -279,7 +279,7 @@ func Empty(shape []int64, args ...interface{}) (parray *Array, err error) { ctx := Context{KDLCPU, 0} if len(shape) < 1 { - err = fmt.Errorf("Invalid shape for Array creation: %v\n", len(shape)) + err = fmt.Errorf("Invalid shape for Array creation: %v", len(shape)) return } @@ -290,7 +290,7 @@ func Empty(shape []int64, args ...interface{}) (parray *Array, err error) { case Context: ctx = args[i].(Context) default: - err = fmt.Errorf("Invalid Optional Argument Type: %T\n", val) + err = fmt.Errorf("Invalid Optional Argument Type: %T", val) return } } diff --git a/golang/src/value.go b/golang/src/value.go index 2a953560f2370..c51805082bebe 100644 --- a/golang/src/value.go +++ b/golang/src/value.go @@ -307,7 +307,7 @@ func (tvmval *Value) setValue(val interface{}) (retVal int32, err error) { case func (args ...*Value) (interface{}, error): fhandle, apierr := ConvertFunction(val) if apierr != nil { - err = fmt.Errorf("Given value Type not defined for Value: %v : %T\n", val, val); + err = fmt.Errorf("Given value Type not defined for Value: %v : %T", val, val); return } tvmval.setVFHandle(*fhandle) @@ -320,7 +320,7 @@ func (tvmval *Value) setValue(val interface{}) (retVal int32, err error) { fromval := val.(Value) tvmval.moveFrom(&fromval) default: - err = fmt.Errorf("Given value Type not defined for Value: %v : %T\n", val, val); + err = fmt.Errorf("Given value Type not defined for Value: %v : %T", val, val); } retVal = tvmval.dtype return