Method
GetStringMap
(key string, useDeleteSentinel bool)
Source from the content-addressed store, hash-verified
| 53 | } |
| 54 | |
| 55 | func (m MetaMapType) GetStringMap(key string, useDeleteSentinel bool) map[string]string { |
| 56 | mval := m.GetMap(key) |
| 57 | if len(mval) == 0 { |
| 58 | return nil |
| 59 | } |
| 60 | rtn := make(map[string]string, len(mval)) |
| 61 | for k, v := range mval { |
| 62 | if v == nil { |
| 63 | if useDeleteSentinel { |
| 64 | rtn[k] = MetaMap_DeleteSentinel |
| 65 | } |
| 66 | continue |
| 67 | } |
| 68 | if s, ok := v.(string); ok { |
| 69 | rtn[k] = s |
| 70 | } |
| 71 | } |
| 72 | return rtn |
| 73 | } |
| 74 | |
| 75 | func (m MetaMapType) GetBool(key string, def bool) bool { |
| 76 | if v, ok := m[key]; ok { |
Tested by
no test coverage detected