(path string, componentA ComponentDefinition, componentB ComponentDefinition)
| 675 | |
| 676 | |
| 677 | func diffComponentAttributes(path string, componentA ComponentDefinition, componentB ComponentDefinition) ([]ComponentDiffAttributeChange, error) { |
| 678 | changes := make([]ComponentDiffAttributeChange, 0) |
| 679 | |
| 680 | if (componentA.Year != componentB.Year) { |
| 681 | var change ComponentDiffAttributeChange |
| 682 | change.Path = path + "/year" |
| 683 | change.OldValue = string(componentA.Year) |
| 684 | change.NewValue = string(componentB.Year) |
| 685 | changes = append(changes, change) |
| 686 | } |
| 687 | if (componentA.NameSpace != componentB.NameSpace) { |
| 688 | var change ComponentDiffAttributeChange |
| 689 | change.Path = path + "/namespace" |
| 690 | change.OldValue = componentA.NameSpace |
| 691 | change.NewValue = componentB.NameSpace |
| 692 | changes = append(changes, change) |
| 693 | } |
| 694 | if (componentA.LibraryName != componentB.LibraryName) { |
| 695 | var change ComponentDiffAttributeChange |
| 696 | change.Path = path + "/libraryname" |
| 697 | change.OldValue = componentA.LibraryName |
| 698 | change.NewValue = componentB.LibraryName |
| 699 | changes = append(changes, change) |
| 700 | } |
| 701 | if (componentA.BaseName != componentB.BaseName) { |
| 702 | var change ComponentDiffAttributeChange |
| 703 | change.Path = path + "/basename" |
| 704 | change.OldValue = componentA.BaseName |
| 705 | change.NewValue = componentB.BaseName |
| 706 | changes = append(changes, change) |
| 707 | } |
| 708 | return changes, nil |
| 709 | } |
| 710 | |
| 711 | // DiffComponentDefinitions generates a diff D = B - A between component definitions A and B such that A + D = B |
| 712 | func DiffComponentDefinitions(A ComponentDefinition, B ComponentDefinition) (ComponentDiff, error) { |
no outgoing calls
no test coverage detected