Skip to content

Commit

Permalink
Fix (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
guanguans committed Sep 16, 2022
1 parent 0e97e2a commit e133007
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion id_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package idvalidator

import (
"errors"
"strconv"
"time"

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

// 性别
sex := 1
if (cast.ToInt(code["order"]) % 2) == 0 {
order, _ := strconv.Atoi(code["order"])
if (order % 2) == 0 {
sex = 0
}

Expand Down

0 comments on commit e133007

Please sign in to comment.