From c16a994fd44fd43e081ecf0f8466037f4d5d852e Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Fri, 13 Jan 2023 16:19:21 +0800 Subject: [PATCH] 1 --- internal/api_to_rpc/copy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/api_to_rpc/copy.go b/internal/api_to_rpc/copy.go index 95d110c60..5052afef9 100644 --- a/internal/api_to_rpc/copy.go +++ b/internal/api_to_rpc/copy.go @@ -7,7 +7,10 @@ import ( ) func CopyAny(from, to interface{}) { - t := reflect.ValueOf(to).Elem() + t := reflect.ValueOf(to) + if t.Kind() == reflect.Ptr { + t = t.Elem() + } if !t.CanSet() { return }