From 41d9614cfbd5a799879ea47aa1ff8bbd15c48862 Mon Sep 17 00:00:00 2001 From: ikawaha Date: Sat, 20 Jan 2024 16:16:16 +0900 Subject: [PATCH] fix: Fix error handling --- cmd/lattice/cmd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/lattice/cmd.go b/cmd/lattice/cmd.go index d4d1ddf..7bb6a36 100644 --- a/cmd/lattice/cmd.go +++ b/cmd/lattice/cmd.go @@ -59,7 +59,7 @@ func (o *option) parse(args []string) error { } // validations if o.flagSet.NArg() == 0 { - return fmt.Errorf("input is empty") + return errors.New("no option is specified") } if o.dict != "" && o.dict != "ipa" && o.dict != "uni" { return fmt.Errorf("invalid argument: -dict %v", o.dict) @@ -153,7 +153,7 @@ func Run(ctx context.Context, args []string) error { if err := opt.parse(args); err != nil { Usage() PrintDefaults(flag.ContinueOnError) - return errors.New("") + return err } return command(ctx, opt) }