Skip to content

Commit

Permalink
refactor dgate cli run function, add more test to increase coverage f…
Browse files Browse the repository at this point in the history
…or dgate-cli
  • Loading branch information
bubbajoe committed May 11, 2024
1 parent 57a9c71 commit 5dd3fd9
Show file tree
Hide file tree
Showing 10 changed files with 822 additions and 93 deletions.
7 changes: 2 additions & 5 deletions cmd/dgate-cli/commands/run_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"golang.org/x/term"
)

func Run(client dgclient.DGateClient, version string) {
func Run(client dgclient.DGateClient, version string) error {
if buildInfo, ok := debug.ReadBuildInfo(); ok {
bv := buildInfo.Main.Version
if bv != "" && bv != "(devel)" {
Expand Down Expand Up @@ -106,8 +106,5 @@ func Run(client dgclient.DGateClient, version string) {
},
}

if err := app.Run(os.Args); err != nil {
fmt.Println(err)
os.Exit(1)
}
return app.Run(os.Args)
}
Loading

0 comments on commit 5dd3fd9

Please sign in to comment.