Test Failed
Push — master ( 8b438c...b1a3db )
by iLex
01:40
created

hkid.CheckPart   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
nop 3
1
package hkid
2
3
func CheckString(string string) *result {
0 ignored issues
show
introduced by
exported function CheckString should have comment or be unexported
Loading history...
introduced by
exported func CheckString returns unexported type *hkid.result, which can be annoying to use
Loading history...
4
	hkid, e := validatePatten(string)
5
	if e != nil {
6
		return newHkidResultWithValid(newHkidNil(), false)
7
	}
8
9
	if getRemainder(hkid) == hkid.part3 {
10
		return newHkidResultWithValid(hkid, true)
11
	}
12
13
	return newHkidResultWithValid(hkid, false)
14
}
15
16
func CheckPart(part1 string, part2 string, part3 string) *result {
0 ignored issues
show
introduced by
exported function CheckPart should have comment or be unexported
Loading history...
introduced by
exported func CheckPart returns unexported type *hkid.result, which can be annoying to use
Loading history...
17
	hkid := newHkid(part1, part2, part3)
18
	return CheckString(hkid.Format())
19
}
20