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

hkid.go   A

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 11
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hkid.CheckPart 0 3 1
A hkid.CheckString 0 11 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