Diff returns all new strings collected since the last time Diff was called
()
| 130 | |
| 131 | // Diff returns all new strings collected since the last time Diff was called |
| 132 | func (d *ScopedDistinctString) Diff() (map[string][]string, error) { |
| 133 | if !d.diffEnabled { |
| 134 | return nil, errDiffNotEnabled |
| 135 | } |
| 136 | |
| 137 | d.mtx.Lock() |
| 138 | defer d.mtx.Unlock() |
| 139 | |
| 140 | ss := map[string][]string{} |
| 141 | |
| 142 | for k, v := range d.cols { |
| 143 | diff, err := v.Diff() |
| 144 | if err != nil { |
| 145 | return nil, err |
| 146 | } |
| 147 | |
| 148 | if len(diff) > 0 { |
| 149 | ss[k] = diff |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | return ss, nil |
| 154 | } |
no outgoing calls