diff options
author | Yarden Shoham <hrsi88@gmail.com> | 2023-02-03 19:22:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-03 17:22:11 +0000 |
commit | ce4fd95233b0012fa5510bd3f2d049a0edac7903 (patch) | |
tree | 332a7c28fc6a67d8c8137de13d139b77f4709789 /modules/setting/setting.go | |
parent | cfb1cb1168726a3a4c13aeafaa9728d82e7e84fe (diff) | |
download | gitea-ce4fd95233b0012fa5510bd3f2d049a0edac7903.tar.gz gitea-ce4fd95233b0012fa5510bd3f2d049a0edac7903.zip |
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 <hrsi88@gmail.com>
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r-- | modules/setting/setting.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index f591727ca3..afd7a40150 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -6,6 +6,7 @@ package setting import ( "encoding/base64" + "errors" "fmt" "math" "net" @@ -466,8 +467,7 @@ func getAppPath() (string, error) { } if err != nil { - // FIXME: Once we switch to go 1.19 use !errors.Is(err, exec.ErrDot) - if !strings.Contains(err.Error(), "cannot run executable found relative to current directory") { + if !errors.Is(err, exec.ErrDot) { return "", err } appPath, err = filepath.Abs(os.Args[0]) |