-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
75 lines (61 loc) · 1.46 KB
/
main.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package main
import (
"flag"
"github.com/liserjrqlxue/anno2xlsx/v2/anno"
"github.com/liserjrqlxue/goUtil/jsonUtil"
"github.com/liserjrqlxue/goUtil/textUtil"
"log"
_ "net/http/pprof"
"os"
"path/filepath"
"github.com/liserjrqlxue/goUtil/osUtil"
"github.com/liserjrqlxue/goUtil/simpleUtil"
"github.com/liserjrqlxue/version"
)
func init() {
version.LogVersion()
flag.Parse()
checkFlag()
// log
logFile, err = os.Create(*logfile)
simpleUtil.CheckErr(err)
log.Printf("Log file : %v\n", *logfile)
log.SetOutput(logFile)
log.SetFlags(log.Ldate | log.Ltime)
log.Printf("Log file : %v\n", *logfile)
version.LogVersion()
// 解析配置
parseToml()
parseCfg()
var funcitonLevel = filepath.Join(etcPath, "function.level.json")
if osUtil.FileExists(funcitonLevel) {
anno.FuncInfo = jsonUtil.JsonFile2MapInt(funcitonLevel)
}
var productEn = textUtil.File2Array(filepath.Join(etcPath, "product.en.list"))
for i := range productEn {
isEnProduct[productEn[i]] = true
}
isEN = isEnProduct[*productID]
}
func main() {
defer simpleUtil.DeferClose(logFile)
// 读取数据库
loadDb()
// 准备excel输出
prepareExcel()
// 填充sheet
fillSheet()
// 保存excel
saveExcel()
// 输出json
if *outJson {
if *qc != "" {
// 输出特定字段格式的quality.json
qc2json(qualitys[0], *prefix+".quality.json")
}
if *snv != "" {
// hash array 输出 json list
mapArray2jsonList(tier1Data, *prefix+".tier1.json")
}
}
}