Skip to content

Commit

Permalink
small refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
chadell committed Dec 8, 2017
1 parent 29a2ba3 commit 3f2a9b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/tcpgoon.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ func validateRequiredArgs(params *tcpgoonParams, args []string) error {
return errors.New("Number of required parameters doesn't match")
}
params.hostPtr = args[0]
if port, err := strconv.Atoi(args[1]); err != nil && port <= 0 {
port, err := strconv.Atoi(args[1])
if err != nil && port <= 0 {
return errors.New("Port argument is not a valid integer")
} else {
params.portPtr = port
}
params.portPtr = port

return nil
}

Expand Down

0 comments on commit 3f2a9b7

Please sign in to comment.