Skip to content

Commit

Permalink
string nil and add return
Browse files Browse the repository at this point in the history
Signed-off-by: bufferflies <1045931706@qq.com>
  • Loading branch information
bufferflies committed Dec 21, 2021
1 parent 08931b3 commit 8ef5d44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions tools/pd-ctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func main() {
in, err := pdctl.ReadStdin(os.Stdin)
if err != nil {
fmt.Println(err)
return
}
inputs = in
}
Expand Down
2 changes: 1 addition & 1 deletion tools/pd-ctl/pdctl/ctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func ReadStdin(r io.Reader) (input []string, err error) {
if err != nil {
return nil, err
}
if s := strings.TrimSpace(string(b)); s != "" {
if s := strings.TrimSpace(string(b)); len(s) > 0 {
input = strings.Split(s, " ")
}
return input, nil
Expand Down

0 comments on commit 8ef5d44

Please sign in to comment.