Skip to content

Commit

Permalink
Ignoreing case for name and rank of unit when comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftregister-vg committed Feb 26, 2020
1 parent 37d5203 commit 70db21d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/data/sw-legion-data.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package data
import (
"fmt"
"github.com/StarWarsDev/go-legion-data"
"strings"
"time"
)

Expand Down Expand Up @@ -32,7 +33,8 @@ func ExtUnit(name, rank string) (*legiondata.Unit, error) {
}

for _, unit := range data.Units {
if unit.Name == name && unit.Rank == rank {
if strings.ToLower(unit.Name) == strings.ToLower(name) &&
strings.ToLower(unit.Rank) == strings.ToLower(rank) {
return &unit, nil
}
}
Expand Down

0 comments on commit 70db21d

Please sign in to comment.