Skip to content

Commit e133007

Browse files
committed
Fix (#31)
1 parent 0e97e2a commit e133007

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

id_validator.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package idvalidator
66

77
import (
88
"errors"
9+
"strconv"
910
"time"
1011

1112
"github.com/guanguans/id-validator/data"
@@ -83,7 +84,8 @@ func GetInfo(id string, strict bool) (IdInfo, error) {
8384

8485
// 性别
8586
sex := 1
86-
if (cast.ToInt(code["order"]) % 2) == 0 {
87+
order, _ := strconv.Atoi(code["order"])
88+
if (order % 2) == 0 {
8789
sex = 0
8890
}
8991

0 commit comments

Comments
 (0)