code: func addToMap(cg comparable, result map[string]comparable) error {
  	var fqPath string
  
  	switch {
  	case cg.ConfigGroup != nil:
  		fqPath = groupPrefix
  	case cg.ConfigValue != nil:
  		fqPath = valuePrefix
  	case cg.ConfigPolicy != nil:
  		fqPath = policyPrefix
  	}
  
  	if err := validateConfigID(cg.key); err != nil {
  		return fmt.Errorf("Illegal characters in key: %s", fqPath)
  	}
  
  	if len(cg.path) == 0 {
  		fqPath += pathSeparator + cg.key
  	} else {
  		fqPath += pathSeparator + strings.Join(cg.path, pathSeparator) + pathSeparator + cg.key
  	}
  
  	logger.Debugf("Adding to config map: %s", fqPath)
  
  	result[fqPath] = cg
  
  	return nil
  }
docs: // addToMap is used only internally by mapConfig