修复map类型可能panic问题
This commit is contained in:
parent
8308761f72
commit
2886126ae7
3
map.go
3
map.go
@ -31,6 +31,9 @@ func EasyMap(mapData interface{}) Map {
|
|||||||
//
|
//
|
||||||
// Date : 15:06 2023/8/10
|
// Date : 15:06 2023/8/10
|
||||||
func EasyMapWithError(mapData interface{}) (Map, error) {
|
func EasyMapWithError(mapData interface{}) (Map, error) {
|
||||||
|
if nil == mapData {
|
||||||
|
return easymap.NewNormal(true), nil
|
||||||
|
}
|
||||||
m := easymap.NewNormal(true)
|
m := easymap.NewNormal(true)
|
||||||
reflectType := reflect.TypeOf(mapData)
|
reflectType := reflect.TypeOf(mapData)
|
||||||
if reflectType.Kind() != reflect.Map {
|
if reflectType.Kind() != reflect.Map {
|
||||||
|
Loading…
Reference in New Issue
Block a user