Skip to content

Commit ce4fd95

Browse files
authored
Use native error checking with exec.ErrDot (#22735)
This was meant to land in #22073 but was blocked until #22732 was merged Signed-off-by: Yarden Shoham <[email protected]>
1 parent cfb1cb1 commit ce4fd95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/setting/setting.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package setting
66

77
import (
88
"encoding/base64"
9+
"errors"
910
"fmt"
1011
"math"
1112
"net"
@@ -466,8 +467,7 @@ func getAppPath() (string, error) {
466467
}
467468

468469
if err != nil {
469-
// FIXME: Once we switch to go 1.19 use !errors.Is(err, exec.ErrDot)
470-
if !strings.Contains(err.Error(), "cannot run executable found relative to current directory") {
470+
if !errors.Is(err, exec.ErrDot) {
471471
return "", err
472472
}
473473
appPath, err = filepath.Abs(os.Args[0])

0 commit comments

Comments
 (0)