code: func (c *Configs) union(rhs *Configs) (*Configs, error) {
  	// Merge the keys of ConfigVariables for each Configs instances. All the new
  	// variables will become unbounded. This requires realigning the keys.
  	configVariables := uniqueMergeSortedStrings(
  		c.ConfigVariables, rhs.ConfigVariables)
  	out := newConfigs(configVariables)
  	byConfig := configPairs(append(
  		c.expandConfigVariables(configVariables),
  		rhs.expandConfigVariables(configVariables)...))
  	if len(byConfig) == 0 {
  		return out, nil
  	}
  	// Take union of ConfigSettings with the same configName (key),
  	// in order left, right.
  	// Thus, preserve the order between left, right while sorting.
  	sort.Stable(byConfig)
  	last := byConfig[0]
  	for _, curr := range byConfig[1:] {
  		if last.key.compare(curr.key) == 0 {
  			val, err := last.value.union(curr.value)
  			if err != nil {
  				return out, err
  			}
  			last.value = val
  		} else {
  			out.setConfig(last.key, last.value)
  			last = curr
  		}
  	}
  	out.setConfig(last.key, last.value)
  	return out, nil
  }
docs: // union returns a new Configs instance, the union of variables from self and rhs.
  //
  // It keeps ConfigVariables sorted in the output.