From 2886126ae73ba9d08dfe52b7eeca8a5d753e9df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sun, 27 Aug 2023 14:40:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmap=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=8F=AF=E8=83=BDpanic=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- map.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/map.go b/map.go index 127b707..7bfc1e1 100644 --- a/map.go +++ b/map.go @@ -31,6 +31,9 @@ func EasyMap(mapData interface{}) Map { // // Date : 15:06 2023/8/10 func EasyMapWithError(mapData interface{}) (Map, error) { + if nil == mapData { + return easymap.NewNormal(true), nil + } m := easymap.NewNormal(true) reflectType := reflect.TypeOf(mapData) if reflectType.Kind() != reflect.Map {