-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate.go
36 lines (31 loc) · 708 Bytes
/
generate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package docs_code
import (
"github.com/sshaplygin/docs-code/bik"
"github.com/sshaplygin/docs-code/inn"
"github.com/sshaplygin/docs-code/kpp"
"github.com/sshaplygin/docs-code/ogrn"
"github.com/sshaplygin/docs-code/ogrnip"
"github.com/sshaplygin/docs-code/snils"
)
type GenerateFunc func() string
func Generate(docType DocType) string {
var callFunc GenerateFunc
switch docType {
case BIK:
callFunc = bik.Generate
case INN:
callFunc = inn.Generate
case KPP:
callFunc = kpp.Generate
case OGRN:
callFunc = ogrn.Generate
case OGRNIP:
callFunc = ogrnip.Generate
case SNILS:
callFunc = snils.Generate
}
if callFunc == nil {
panic("not implemented method")
}
return callFunc()
}