Skip to content

Commit

Permalink
add errcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
0pcom committed Feb 24, 2024
1 parent 5db5c13 commit db98540
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cmd/dmsg-socks5/commands/dmsg-socks5.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package commands
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
Expand All @@ -30,6 +31,12 @@ var (
dmsgPort uint16
)

// Execute executes root CLI command.
func Execute() {
if err := RootCmd.Execute(); err != nil {
log.Fatal("Failed to execute command: ", err)
}
}
func init() {
RootCmd.AddCommand(
serveCmd,
Expand Down
2 changes: 1 addition & 1 deletion cmd/dmsg-socks5/dmsg-socks5.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
NoExtraNewlines: true,
NoBottomNewline: true,
})
commands.RootCmd.Execute()
commands.Execute()
}

const help = "Usage:\r\n" +
Expand Down

0 comments on commit db98540

Please sign in to comment.