Skip to content

Commit

Permalink
do not convert to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
cybre committed Jan 13, 2024
1 parent 80e6a9a commit 4dbb667
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/differ/differ.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ func Diff(file1, file2 File) (Result, error) {
additions := make([]string, 0)
deletions := make([]string, 0)
for _, value := range file1ColumnValues {
if !slices.Contains(file2ColumnValues, value) {
if !slices.ContainsFunc(file2ColumnValues, func(s string) bool {
return strings.ToLower(s) == strings.ToLower(value)
}) {
deletions = append(deletions, value)
}
}

for _, value := range file2ColumnValues {
if !slices.Contains(file1ColumnValues, value) {
if !slices.ContainsFunc(file1ColumnValues, func(s string) bool {
return strings.ToLower(s) == strings.ToLower(value)
}) {
additions = append(additions, value)
}
}
Expand All @@ -60,7 +64,7 @@ func extractColumnValues(file File) ([]string, error) {
break
}

value := strings.TrimFunc(strings.ToLower(row[file.DiffColumnIndex]), func(r rune) bool {
value := strings.TrimFunc(row[file.DiffColumnIndex], func(r rune) bool {
return r == '"' || r == ' '
})

Expand Down

0 comments on commit 4dbb667

Please sign in to comment.