-
Notifications
You must be signed in to change notification settings - Fork 0
/
dirs.go
69 lines (56 loc) · 1.17 KB
/
dirs.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
package main
import (
"os"
"path/filepath"
)
const (
PathFiles = "files"
PathTests = "tests"
PathReports = "report"
PathErrs = "err"
PathImages = "image"
PathTps = "tps"
PathLatency = "latency"
PathCompares = "compare"
)
var (
ReportsDir = filepath.Join(PathTests, PathReports)
ErrsDir = filepath.Join(PathTests, PathErrs)
ImagesDir = filepath.Join(PathTests, PathImages)
ImagesTpsDir = filepath.Join(ImagesDir, PathTps)
ImagesLatencyDir = filepath.Join(ImagesDir, PathLatency)
CompareTpsDir = filepath.Join(PathCompares, PathTps)
CompareLatencyDir = filepath.Join(PathCompares, PathLatency)
)
func initDirs() int {
ec := 0
e := os.MkdirAll(PathFiles, os.ModePerm)
if e != nil {
ec++
}
e = os.MkdirAll(ReportsDir, os.ModePerm)
if e != nil {
ec++
}
e = os.MkdirAll(ErrsDir, os.ModePerm)
if e != nil {
ec++
}
e = os.MkdirAll(ImagesTpsDir, os.ModePerm)
if e != nil {
ec++
}
e = os.MkdirAll(ImagesLatencyDir, os.ModePerm)
if e != nil {
ec++
}
e = os.MkdirAll(CompareTpsDir, os.ModePerm)
if e != nil {
ec++
}
e = os.MkdirAll(CompareLatencyDir, os.ModePerm)
if e != nil {
ec++
}
return ec
}