String returns a human-readable string representing the edit-script where Identity, UniqueX, UniqueY, and Modified are represented by the '.', 'X', 'Y', and 'M' characters, respectively.
()
| 40 | // Identity, UniqueX, UniqueY, and Modified are represented by the |
| 41 | // '.', 'X', 'Y', and 'M' characters, respectively. |
| 42 | func (es EditScript) String() string { |
| 43 | b := make([]byte, len(es)) |
| 44 | for i, e := range es { |
| 45 | switch e { |
| 46 | case Identity: |
| 47 | b[i] = '.' |
| 48 | case UniqueX: |
| 49 | b[i] = 'X' |
| 50 | case UniqueY: |
| 51 | b[i] = 'Y' |
| 52 | case Modified: |
| 53 | b[i] = 'M' |
| 54 | default: |
| 55 | panic("invalid edit-type") |
| 56 | } |
| 57 | } |
| 58 | return string(b) |
| 59 | } |
| 60 | |
| 61 | // stats returns a histogram of the number of each type of edit operation. |
| 62 | func (es EditScript) stats() (s struct{ NI, NX, NY, NM int }) { |
nothing calls this directly
no outgoing calls
no test coverage detected