Line duplicate detection error messages up
@@ -228,16 +228,16 @@ func (ca *configAware) getResourcesByID(ctx context.Context) (map[string]resourc
// detected by the parsing code). But were that to
// change, e.g., if `resources` were a slice of
// resources, we would want to catch it here.
- duplicateErr = fmt.Errorf("duplicate definitions of resource %s generated by %s",
+ duplicateErr = fmt.Errorf("duplicate definition of '%s' (generated by %s)",
id, cf.ConfigRelativeToWorkingDir())
case duplicate.configFile != nil:
// the duplicate is from another config file
dupCf := duplicate.configFile
- duplicateErr = fmt.Errorf("duplicate definition of resource %s generated by %s and %s",
+ duplicateErr = fmt.Errorf("duplicate definition of '%s' (generated by %s and by %s)",
id, cf.ConfigRelativeToWorkingDir(), dupCf.ConfigRelativeToWorkingDir())
default:
// the duplicate is from a raw file
- duplicateErr = fmt.Errorf("duplicate definition of resource %s generated by %s and in file %s",
+ duplicateErr = fmt.Errorf("duplicate definition of '%s' (generated by %s and in %s)",
id, cf.ConfigRelativeToWorkingDir(), duplicate.resource.Source())
}
return nil, duplicateErr
