Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f733f45

Browse files
committed
grr fmt.Errorf
1 parent 818b6e7 commit f733f45

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cli/clibase/cmd.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package clibase
33
import (
44
"context"
55
"errors"
6-
"fmt"
76
"io"
87
"os"
98
"strings"
@@ -370,7 +369,7 @@ func RequireRangeArgs(start, end int) MiddlewareFunc {
370369
case 0:
371370
return xerrors.Errorf("wanted no args but got %v %v", got, i.Args)
372371
default:
373-
return fmt.Errorf(
372+
return xerrors.Errorf(
374373
"wanted %v args but got %v %v",
375374
start,
376375
got,
@@ -380,7 +379,7 @@ func RequireRangeArgs(start, end int) MiddlewareFunc {
380379
case start > 0 && end == -1:
381380
switch {
382381
case got < start:
383-
return fmt.Errorf(
382+
return xerrors.Errorf(
384383
"wanted at least %v args but got %v",
385384
start,
386385
got,
@@ -391,7 +390,7 @@ func RequireRangeArgs(start, end int) MiddlewareFunc {
391390
case start > end:
392391
panic("start must be <= end")
393392
case got < start || got > end:
394-
return fmt.Errorf(
393+
return xerrors.Errorf(
395394
"wanted between %v and %v args but got %v",
396395
start, end,
397396
got,

0 commit comments

Comments
 (0)