(word string)
| 394 | } |
| 395 | |
| 396 | func (w *WordCounter) Add(word string) { |
| 397 | if _, loaded := w.words.LoadOrStore(xxhash.Sum64String(word), struct{}{}); !loaded { |
| 398 | w.count.Add(1) |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | func (w *WordCounter) String() string { |
| 403 | b, _ := json.Marshal(w.Value()) |