Skip to content

Commit

Permalink
Use native error checking with exec.ErrDot (#22735)
Browse files Browse the repository at this point in the history
This was meant to land in #22073 but was blocked until #22732 was merged

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
  • Loading branch information
yardenshoham authored Feb 3, 2023
1 parent cfb1cb1 commit ce4fd95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package setting

import (
"encoding/base64"
"errors"
"fmt"
"math"
"net"
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit ce4fd95

Please sign in to comment.