You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

types.go 276B

1234567891011121314151617
  1. // Copyright (c) 2020 Shivaram Lingamneni
  2. // released under the MIT license
  3. package utils
  4. type empty struct{}
  5. type StringSet map[string]empty
  6. func (s StringSet) Has(str string) bool {
  7. _, ok := s[str]
  8. return ok
  9. }
  10. func (s StringSet) Add(str string) {
  11. s[str] = empty{}
  12. }