all: replace execabs with os/exec

os/exec no longer searches executablse in the current directory as of
Go 1.19. See https://go.dev/blog/path-security and https://go.dev/issue/43724.
This commit is contained in:
Hajime Hoshi 2024-05-03 23:39:36 +09:00
parent 903ab6727b
commit c658a25171
5 changed files with 5 additions and 6 deletions

View File

@ -23,10 +23,10 @@ import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
exec "golang.org/x/sys/execabs"
"golang.org/x/tools/go/packages"
)

View File

@ -18,13 +18,13 @@ import (
_ "embed"
"fmt"
"os"
"os/exec"
"path/filepath"
"runtime"
"runtime/debug"
// Add a dependency on gomobile in order to get the version via debug.ReadBuildInfo().
_ "github.com/ebitengine/gomobile/geom"
exec "golang.org/x/sys/execabs"
)
//go:embed gobind.go

View File

@ -27,12 +27,12 @@ import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
"text/template"
"unicode"
exec "golang.org/x/sys/execabs"
"golang.org/x/tools/go/packages"
)

View File

@ -23,13 +23,13 @@ import (
"go/parser"
"go/token"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
exec "golang.org/x/sys/execabs"
"golang.org/x/tools/go/ast/astutil"
)

View File

@ -20,14 +20,13 @@ import (
"bytes"
"context"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"sync"
"testing"
"time"
exec "golang.org/x/sys/execabs"
)
func isWSL() (bool, error) {