]> source.dussan.org Git - gitea.git/commitdiff
Use native error checking with `exec.ErrDot` (#22735)
authorYarden Shoham <hrsi88@gmail.com>
Fri, 3 Feb 2023 17:22:11 +0000 (19:22 +0200)
committerGitHub <noreply@github.com>
Fri, 3 Feb 2023 17:22:11 +0000 (17:22 +0000)
This was meant to land in #22073 but was blocked until #22732 was merged

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
modules/setting/setting.go

index f591727ca3421a7c71a743a9f4c5c3eede7dfbe0..afd7a40150d25663836ca350aba0cd3d3040f97a 100644 (file)
@@ -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])