Skip to content

Commit

Permalink
golint: properly handle defer engine stop
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsmaycon committed Jun 21, 2021
1 parent a87f828 commit 5122294
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ var (
iFaceBlackList[config.IFaceBlackList[i]] = struct{}{}
}
engine := connection.NewEngine(signalClient, config.StunTurnURLs, config.WgIface, config.WgAddr, iFaceBlackList)
defer engine.Stop()
defer func() {
err := engine.Stop()
if err != nil {
log.Fatal(err)
}
}()

err = engine.Start(myKey, config.Peers)
if err != nil {
Expand Down

0 comments on commit 5122294

Please sign in to comment.