From a654073c71275632b9495bbc849e4dbbee7f513a Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Thu, 30 Dec 2021 21:09:37 +0800 Subject: [PATCH] Refactor code --- internal/utils/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/utils/utils.go b/internal/utils/utils.go index 45fe64435..444e6f730 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -6,9 +6,9 @@ import ( "github.com/golang/protobuf/proto" ) -func JsonDataList(resp interface{}) []map[string]interface{} { +func JsonDataList(resp ...interface{}) []map[string]interface{} { result := make([]map[string]interface{}, 0) - for _, v := range resp.([]proto.Message) { + for _, v := range resp { m := ProtoToMap(v.(proto.Message), false) result = append(result, m) }