| Conditions | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | //package hkid to check HKID Card No. |
||
| 5 | func CheckString(string string) *result { |
||
| 6 | 1 | hkid, e := validatePatten(string) |
|
| 7 | //if errors.Is(e, newPatterNotMatchError()) { |
||
| 8 | 1 | if e != nil { |
|
| 9 | 1 | return newHkidResultWithValid(newHkidNil(), false) |
|
| 10 | } |
||
| 11 | |||
| 12 | 1 | if getRemainder(hkid) == hkid.part3 { |
|
| 13 | 1 | return newHkidResultWithValid(hkid, true) |
|
| 14 | } |
||
| 15 | |||
| 16 | 1 | return newHkidResultWithValid(hkid, false) |
|
| 17 | } |
||
| 27 |