Skip to content

Commit

Permalink
execabs: isGo119ErrDot: use errors.Is instead of string-matching
Browse files Browse the repository at this point in the history
Addresses the TODO added in CL 403256.
  • Loading branch information
thaJeztah committed Nov 10, 2022
1 parent fc697a3 commit 99ba4c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions execabs/execabs_go119.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

package execabs

import "strings"
import (
"errors"
"os/exec"
)

func isGo119ErrDot(err error) bool {
// TODO: return errors.Is(err, exec.ErrDot)
return strings.Contains(err.Error(), "current directory")
return errors.Is(err, exec.ErrDot)
}

0 comments on commit 99ba4c2

Please sign in to comment.