code: func Union(sets ...*Set) *Set {
  	estimateIDs := 0
  	estimateGroups := 0
  
  	for _, s := range sets {
  		if s == nil {
  			continue
  		}
  		if s.All {
  			return &Set{All: true}
  		}
  		if len(s.IDs) > estimateIDs {
  			estimateIDs = len(s.IDs)
  		}
  		if len(s.Groups) > estimateGroups {
  			estimateGroups = len(s.Groups)
  		}
  	}
  
  	union := &Set{}
  	if estimateIDs != 0 {
  		union.IDs = make(identSet, estimateIDs)
  	}
  	if estimateGroups != 0 {
  		union.Groups = make(groupSet, estimateGroups)
  	}
  
  	for _, s := range sets {
  		if s == nil {
  			continue
  		}
  		for ident := range s.IDs {
  			union.IDs[ident] = struct{}{}
  		}
  		for group := range s.Groups {
  			union.Groups[group] = struct{}{}
  		}
  	}
  
  	return union
  }
docs: // Union returns a union of a list of sets.