-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (40 loc) · 731 Bytes
/
main.go
File metadata and controls
46 lines (40 loc) · 731 Bytes
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
package main
import (
"log"
"os"
"os/signal"
"syscall"
"github.com/davecgh/go-spew/spew"
"github.com/hammertrack/tracker/internal/bot"
"github.com/hammertrack/tracker/logger"
)
func waitSignInt() {
sigint := make(chan os.Signal, 1)
signal.Notify(
sigint,
os.Interrupt,
syscall.SIGINT,
syscall.SIGTERM,
syscall.SIGABRT,
syscall.SIGQUIT,
)
<-sigint
log.Print("Stopping hammertrack tracker")
}
// TODO - Clean and re-structure some logs
// TODO - Tests
// TODO - Rename everything from hammertrace to hammertrack
func main() {
b := bot.New()
go func() {
b.Start()
}()
waitSignInt()
b.Stop()
}
func init() {
spew.Config.Indent = "\t"
log.SetFlags(0)
log.SetOutput(logger.New())
printBanner()
}