Skip to content

Commit

Permalink
Remove obsolete style parameter in ComparePaths
Browse files Browse the repository at this point in the history
The style parameter is not in use anymore.

Remove obsolete parameter in function and all dependent functions.
  • Loading branch information
HeavyWombat committed Sep 4, 2020
1 parent 3f2d616 commit 21a6f7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions path.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ func ComparePathsByValue(fromLocation string, toLocation string, duplicatePaths
}

// ComparePaths returns all duplicate Path structures between two documents.
func ComparePaths(fromLocation string, toLocation string, style PathStyle, compareByValue bool) ([]Path, error) {
func ComparePaths(fromLocation string, toLocation string, compareByValue bool) ([]Path, error) {
var duplicatePaths []Path

pathsFromLocation, err := ListPaths(fromLocation, style)
pathsFromLocation, err := ListPaths(fromLocation)
if err != nil {
return nil, err
}
pathsToLocation, err := ListPaths(toLocation, style)
pathsToLocation, err := ListPaths(toLocation)
if err != nil {
return nil, err
}
Expand All @@ -211,7 +211,7 @@ func ComparePaths(fromLocation string, toLocation string, style PathStyle, compa

// ListPaths returns all paths in the documents using the provided choice of
// path style.
func ListPaths(location string, style PathStyle) ([]Path, error) {
func ListPaths(location string) ([]Path, error) {
inputfile, err := LoadFile(location)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ var _ = Describe("path tests", func() {

Context("compare paths between two files", func() {
It("should find only duplicate paths", func() {
list, err := ComparePaths(assets("testbed", "sample_a.yml"), assets("testbed", "sample_b.yml"), GoPatchStyle, false)
list, err := ComparePaths(assets("testbed", "sample_a.yml"), assets("testbed", "sample_b.yml"), false)
Expect(err).ToNot(HaveOccurred())

listOfPaths := []Path{
Expand Down Expand Up @@ -181,7 +181,7 @@ var _ = Describe("path tests", func() {
})

It("should find only paths with the same value", func() {
list, err := ComparePaths(assets("testbed", "sample_a.yml"), assets("testbed", "sample_b.yml"), GoPatchStyle, true)
list, err := ComparePaths(assets("testbed", "sample_a.yml"), assets("testbed", "sample_b.yml"), true)
Expect(err).ToNot(HaveOccurred())

listOfPathsWithSameValue := []Path{
Expand Down

0 comments on commit 21a6f7c

Please sign in to comment.