NewDiffMap creates a frozen, read-only DiffMap from a plain map.
(m map[string]string)
| 24 | |
| 25 | // NewDiffMap creates a frozen, read-only DiffMap from a plain map. |
| 26 | func NewDiffMap(m map[string]string) DiffMap { |
| 27 | cp := make(map[string]string, len(m)) |
| 28 | maps.Copy(cp, m) |
| 29 | return DiffMap{m: cp} |
| 30 | } |
| 31 | |
| 32 | // Get returns the diff text for path. |
| 33 | func (d DiffMap) Get(path string) (string, bool) { |
no outgoing calls