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