func ValidatePluginResponses(pluginResponses []*PluginResponse) error {
	seen := make(map[string]string)
	for _, pluginResponse := range pluginResponses {
		for _, file := range pluginResponse.Response.File {
			if file.GetInsertionPoint() != "" {
				// We expect insertion points to write
				// to files that already exist.
				continue
			}
			fileName := filepath.Join(pluginResponse.PluginOut, file.GetName())
			if pluginName, ok := seen[fileName]; ok {
				return fmt.Errorf(
					"file %q was generated multiple times: once by plugin %q and again by plugin %q",
					fileName,
					pluginName,
					pluginResponse.PluginName,
				)
			}
			seen[fileName] = pluginResponse.PluginName
		}
	}
	return nil
}
// ValidatePluginResponses validates that each file is only defined by a single *PluginResponse.
ValidatePluginResponses validates that each file is only defined by a single *PluginResponse.
// ValidatePluginResponses validates that each file is only defined by a single * PluginResponse .
func ValidatePluginResponses(pluginResponses []*PluginResponse) error {
	seen := make(map[string]string)
	for _, pluginResponse := range pluginResponses {
		for _, file := range pluginResponse.Response.File {
			if file.GetInsertionPoint() != "" {
				continue
			}
			fileName := filepath.Join(pluginResponse.PluginOut, file.GetName())
			if pluginName, ok := seen[fileName]; ok {
				return fmt.Errorf(
					"file %q was generated multiple times: once by plugin %q and again by plugin %q",
					fileName,
					pluginName,
					pluginResponse.PluginName,
				)
			}
			seen[fileName] = pluginResponse.PluginName
		}
	}
	return nil
}
func ValidatePluginResponses ( pluginResponses [ ] * PluginResponse ) error { seen := make ( map [ string ] string ) for _ , pluginResponse := range pluginResponses { for _ , file := range pluginResponse . Response . File { if file . GetInsertionPoint ( ) != " " { continue } fileName := filepath . Join ( pluginResponse . PluginOut , file . GetName ( ) ) if pluginName , ok := seen [ fileName ] ; ok { return fmt . Errorf ( " " , fileName , pluginName , pluginResponse . PluginName , ) } seen [ fileName ] = pluginResponse . PluginName } } return nil }
ValidatePluginResponses validates that each file is only defined by a single *PluginResponse.
ValidatePluginResponses validates that each file is only defined by a single * PluginResponse .
// We expect insertion points to write // to files that already exist.