Skip to content

Commit

Permalink
Merge pull request #315 from ikawaha/fix/GO-W1024
Browse files Browse the repository at this point in the history
fix: Fix error handling
  • Loading branch information
ikawaha committed Jan 20, 2024
2 parents 95ea912 + 41d9614 commit d4c4199
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/lattice/cmd.go
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit d4c4199

Please sign in to comment.