NewDiffMap creates a frozen, read-only DiffMap from a plain map.
(m map[string]string)
| 13 | |
| 14 | // NewDiffMap creates a frozen, read-only DiffMap from a plain map. |
| 15 | func NewDiffMap(m map[string]string) DiffMap { |
| 16 | cp := make(map[string]string, len(m)) |
| 17 | for k, v := range m { |
| 18 | cp[k] = v |
| 19 | } |
| 20 | return DiffMap{m: cp} |
| 21 | } |
| 22 | |
| 23 | // Get returns the diff text for path. |
| 24 | func (d DiffMap) Get(path string) (string, bool) { |
no outgoing calls