| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | package hkid |
||
| 2 | |||
| 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 | } |
||
| 16 | |||
| 17 | func CheckPart(part1 string, part2 string, part3 string) *result { |
||
| 18 | 1 | hkid := newHkid(part1, part2, part3) |
|
| 19 | 1 | return CheckString(hkid.Format()) |
|
| 20 | } |
||
| 21 |