Skip to content

Commit

Permalink
get dot object
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrix-X committed Jun 11, 2021
1 parent ba39db0 commit a2b42d6
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion object/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,19 @@ func ConvertStringMapToString(m *StringMap) string {
fmt.Fprintf(b, "%s=\"%s\"\n", key, value)
}
return b.String()
}
}

// Get an item from an hashMap using "dot" notation.
func Get(hashedObject HashMap, key string, defaultValue interface{}) interface{} {
if key==""{
return &hashedObject
}

if hashedObject[key] !=nil{
return hashedObject[key]
}



return nil
}

0 comments on commit a2b42d6

Please sign in to comment.