Resolve golangcibot issues

This commit is contained in:
ErickSkrauch
2020-01-05 20:39:17 +03:00
parent 9946eae73b
commit 17f82ec6d3
8 changed files with 48 additions and 36 deletions

View File

@@ -3,7 +3,9 @@ package cmd
import (
"fmt"
"os"
"os/signal"
"strings"
"syscall"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@@ -35,3 +37,10 @@ func initConfig() {
replacer := strings.NewReplacer(".", "_")
viper.SetEnvKeyReplacer(replacer)
}
func waitForExitSignal() os.Signal {
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
return <-ch
}