Skip to content

Commit e3f4763

Browse files
committed
fix bug
1 parent 0f899eb commit e3f4763

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

models/unit.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,12 @@ var (
144144

145145
// FindUnitTypes give the unit key name and return unit
146146
func FindUnitTypes(nameKeys ...string) (res []UnitType) {
147-
for t, u := range Units {
148-
if strings.EqualFold(u.NameKey, u.NameKey) {
149-
res = append(res, t)
147+
for _, key := range nameKeys {
148+
for t, u := range Units {
149+
if strings.EqualFold(key, u.NameKey) {
150+
res = append(res, t)
151+
break
152+
}
150153
}
151154
}
152155
return

0 commit comments

Comments
 (0)