增加Map为Nil判断

This commit is contained in:
2024-11-19 15:28:47 +08:00
parent e95ed61cfc
commit db7bf0817e
2 changed files with 41 additions and 5 deletions

View File

@ -19,3 +19,12 @@ func TestMap_Exist(t *testing.T) {
fmt.Println(testData.Exist("name"))
fmt.Println(testData.Exist("age"))
}
func TestMap_IsNil(t *testing.T) {
var (
m Map
m1 *Map
)
fmt.Println(m.Set("a", 1))
fmt.Println(m.IsNil(), m1.IsNil())
}