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