Skip to content

Commit 7637cdd

Browse files
committed
Propagate errors from DefaultVersion
1 parent bb6a530 commit 7637cdd

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

defs.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ func NewVersion(cmd *Command, opts ...Option) error {
6464
Special(special),
6565
Exec(func(ctx context.Context) error {
6666
c, _ := Ctx(ctx)
67-
_ = DefaultVersion(c)
68-
return ErrExit
67+
return DefaultVersion(c)
6968
}),
7069
)...)
7170
}

ox.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ var (
8484
if w == nil {
8585
w = os.Stdout
8686
}
87-
fmt.Fprintln(w, name, ver)
87+
_, _ = fmt.Fprintln(w, name, ver)
8888
return ErrExit
8989
}
9090
// DefaultVersionMapper maps the passed name, version.

0 commit comments

Comments
 (0)