@@ -469,7 +469,13 @@ func (yc *YCfg) GetStringMap(
469469 Expr : mapEntry .Expr ,
470470 }
471471
472- // XXX: Report collisions?
472+ if _ , exists := result [k ]; exists {
473+ if (entry .Value != result [k ].Value ) && (result [k ].Expr != nil ) {
474+ return nil , fmt .Errorf ("Setting %s collision - two conditions true:\n [%s, %s]\n " +
475+ "Conflicting file: %s" ,
476+ k , entry .Expr .String (), result [k ].Expr .String (), yc .name )
477+ }
478+ }
473479 result [k ] = entry
474480 }
475481 }
@@ -607,7 +613,13 @@ func (yc *YCfg) GetStringMapString(key string,
607613 Expr : mapEntry .Expr ,
608614 }
609615
610- // XXX: Report collisions?
616+ if _ , exists := result [k ]; exists {
617+ if (entry .Value != result [k ].Value ) && (result [k ].Expr != nil ) {
618+ return nil , fmt .Errorf ("Setting %s collision - two conditions true:\n [%s, %s]\n " +
619+ "Conflicting file: %s" ,
620+ k , entry .Expr .String (), result [k ].Expr .String (), yc .name )
621+ }
622+ }
611623 result [k ] = entry
612624 }
613625 }
@@ -623,6 +635,9 @@ func (yc *YCfg) GetValStringMapString(key string,
623635 settings * cfgv.Settings ) (map [string ]string , error ) {
624636
625637 entryMap , getErr := yc .GetStringMapString (key , settings )
638+ if getErr != nil {
639+ return nil , getErr
640+ }
626641
627642 valMap := make (map [string ]string , len (entryMap ))
628643 for k , v := range entryMap {
@@ -631,7 +646,7 @@ func (yc *YCfg) GetValStringMapString(key string,
631646 }
632647 }
633648
634- return valMap , getErr
649+ return valMap , nil
635650}
636651
637652// FullName calculates a node's name with the following form:
0 commit comments