fix: golint errors (part 2)

This commit is contained in:
braginini
2021-05-19 11:13:25 +02:00
parent 5342f10e7f
commit 790858c31b
9 changed files with 32 additions and 34 deletions

View File

@@ -6,7 +6,6 @@ import (
"github.com/spf13/cobra"
"os"
"os/signal"
"syscall"
)
const (
@@ -41,11 +40,14 @@ func init() {
// SetupCloseHandler handles SIGTERM signal and exits with success
func SetupCloseHandler() {
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
<-c
fmt.Println("\r- Ctrl+C pressed in Terminal")
os.Exit(0)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
for range c {
fmt.Println("\r- Ctrl+C pressed in Terminal")
os.Exit(0)
}
}()
}
// InitLog parses and sets log-level input