-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
39 lines (34 loc) · 746 Bytes
/
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
package main
import (
"github.com/DeathVenom54/github-deploy-inator/config"
"github.com/DeathVenom54/github-deploy-inator/logger"
"os"
)
func main() {
// setting up logger
allFile, err := os.OpenFile("all.log", os.O_RDWR|os.O_APPEND|os.O_CREATE, 0644)
if err != nil {
panic(err)
}
errFile, err := os.OpenFile("error.log", os.O_RDWR|os.O_APPEND|os.O_CREATE, 0644)
if err != nil {
panic(err)
}
// close file
defer func(allFile, errFile *os.File) {
err := allFile.Close()
if err != nil {
panic(err)
}
err = errFile.Close()
if err != nil {
panic(err)
}
}(allFile, errFile)
logger.Setuplogger(allFile, errFile)
// finally, run app
err = config.ExecuteConfig()
if err != nil {
logger.Err.Fatalln(err)
}
}