func (s Set) Copy() Set {
	c := make(Set, len(s))
	for x := range s {
		c.Add(x)
	}
	return c
}
Copy returns a copy of s.
package stringset
import "errors"
type Set map[string]struct{}
func FromSlice(xs []string) Set {
	s := make(Set)
	for _, x := range xs {
		s.Add(x)
	}
	return s
}
func New(xs ...string) Set {
	return FromSlice(xs)
}
func (s Set) Add(x string) {
	s[x] = struct{}{}
}
func (s Set) Remove(x string) {
	delete(s, x)
}
func (s Set) Has(x string) bool {
	_, ok := s[x]
	return ok
}
func (s Set) Sub(s2 Set) Set {
	result := make(Set)
	for x := range s {
		if !s2.Has(x) {
			result.Add(x)
		}
	}
	return result
}
func (s Set) ToSlice() []string {
	var xs []string
	for x := range s {
		xs = append(xs, x)
	}
	return xs
}
func Equal(s1 Set, s2 Set) bool {
	if len(s1) != len(s2) {
		return false
	}
	for x := range s1 {
		if !s2.Has(x) {
			return false
		}
	}
	return true
}