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

@@ -2,7 +2,7 @@ package cmd
import (
"encoding/json"
"github.com/pion/ice/v2"
ice "github.com/pion/ice/v2"
"github.com/wiretrustee/wiretrustee/connection"
"io/ioutil"
"os"

View File

@@ -1,7 +1,7 @@
package cmd
import (
"github.com/pion/ice/v2"
ice "github.com/pion/ice/v2"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"

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

View File

@@ -37,6 +37,7 @@ var (
}
SetupCloseHandler()
select {}
},
}
)

View File

@@ -48,6 +48,7 @@ var (
//signalClient.WaitConnected()
SetupCloseHandler()
select {}
},
}
)