Strings returns the final list of distinct values collected and sorted.
()
| 101 | |
| 102 | // Strings returns the final list of distinct values collected and sorted. |
| 103 | func (d *DistinctString) Strings() []string { |
| 104 | d.mtx.Lock() |
| 105 | defer d.mtx.Unlock() |
| 106 | |
| 107 | ss := make([]string, 0, len(d.values)) |
| 108 | |
| 109 | for k := range d.values { |
| 110 | ss = append(ss, k) |
| 111 | } |
| 112 | |
| 113 | sort.Strings(ss) |
| 114 | return ss |
| 115 | } |
| 116 | |
| 117 | // Exceeded indicates if some values were lost because the maximum size limit was met. |
| 118 | func (d *DistinctString) Exceeded() bool { |
no outgoing calls