Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package is |
||
2 | |||
3 | import "github.com/muonsoft/validation/validate" |
||
4 | |||
5 | // EAN8 checks that string contains valid EAN-8 code. |
||
6 | // |
||
7 | // See https://en.wikipedia.org/wiki/EAN-8. |
||
8 | func EAN8(value string) bool { |
||
9 | return validate.EAN8(value) == nil |
||
10 | } |
||
11 | |||
12 | // EAN13 checks that string contains valid EAN-13 code. |
||
13 | // |
||
14 | // See https://en.wikipedia.org/wiki/International_Article_Number. |
||
15 | func EAN13(value string) bool { |
||
16 | return validate.EAN13(value) == nil |
||
17 | } |
||
18 | |||
19 | // UPCA checks that string contains valid UPC-A code. |
||
20 | // |
||
21 | // See https://en.wikipedia.org/wiki/Universal_Product_Code. |
||
22 | func UPCA(value string) bool { |
||
23 | return validate.UPCA(value) == nil |
||
24 | } |
||
25 | |||
26 | // UPCE checks that string contains valid UPC-E code. |
||
27 | // |
||
28 | // See https://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E. |
||
29 | func UPCE(value string) bool { |
||
30 | return validate.UPCE(value) == nil |
||
31 | } |
||
32 |