errors.Is instead of ==

This commit is contained in:
Bruno Reis 2023-08-06 16:13:48 -07:00
parent 473eb2b847
commit 5563c0faba
1 changed files with 2 additions and 2 deletions

View File

@ -513,10 +513,10 @@ func (p *Parser) Parse(args []string) error {
func (p *Parser) MustParse(args []string) {
err := p.Parse(args)
switch {
case err == ErrHelp:
case errors.Is(err, ErrHelp):
p.writeHelpForSubcommand(p.config.Out, p.lastCmd)
p.config.Exit(0)
case err == ErrVersion:
case errors.Is(err, ErrVersion):
fmt.Fprintln(p.config.Out, p.version)
p.config.Exit(0)
case err != nil: