Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
style: fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy committed Jul 13, 2024
1 parent 34ba6c5 commit d7fbc97
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmd/commands/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,20 @@ func PingCommand(parentCmd *cobra.Command) {

do(conn, conQuery)

verb := ""
details := ""

t := time.Now()

t1 := time.Now()
response := do(conn, "PING")
if *verbose {
verb = fmt.Sprintf("It toked %v to get the response", time.Since(t1).Abs().String())
details = fmt.Sprintf("It toked %v to get the response", time.Since(t).Abs().String())
}

if response == "PONG" {
cmd.Printf("PONG, everything is ok.\n%s\n", verb)
cmd.Printf("PONG, everything is ok.\n%s\n", details)
os.Exit(0)
} else {
ExitOnError(cmd, fmt.Errorf("something went wrong: %v\n%s", response, verb))
ExitOnError(cmd, fmt.Errorf("something went wrong: %v\n%s", response, details))
}
}
}

0 comments on commit d7fbc97

Please sign in to comment.