all: use x/sys/execabs instead of os/exec

Closes #2418
This commit is contained in:
Hajime Hoshi 2022-11-01 23:07:16 +09:00
parent 083835af9a
commit 8aacf067dd
5 changed files with 6 additions and 5 deletions

View File

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

View File

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

View File

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

View File

@ -24,10 +24,10 @@ import (
"go/parser" "go/parser"
"go/token" "go/token"
"os" "os"
"os/exec"
"path/filepath" "path/filepath"
"strings" "strings"
exec "golang.org/x/sys/execabs"
"golang.org/x/tools/go/ast/astutil" "golang.org/x/tools/go/ast/astutil"
) )

View File

@ -20,10 +20,11 @@ package processtest_test
import ( import (
"bytes" "bytes"
"os" "os"
"os/exec"
"path/filepath" "path/filepath"
"strings" "strings"
"testing" "testing"
exec "golang.org/x/sys/execabs"
) )
func TestPrograms(t *testing.T) { func TestPrograms(t *testing.T) {