fix: use golang.org/x/sys/execabs (#224)

Closes https://github.com/ooni/probe-engine/issues/1195
This commit is contained in:
Simone Basso
2021-02-10 07:40:48 +01:00
committed by GitHub
parent f53b3be66e
commit 18ca6d5f35
6 changed files with 25 additions and 20 deletions
@@ -7,12 +7,13 @@ import (
"net/http"
"net/http/httptest"
"net/url"
"os/exec"
"runtime"
"strings"
"testing"
"time"
"golang.org/x/sys/execabs"
"github.com/apex/log"
"github.com/ooni/probe-cli/v3/internal/cmd/jafar/resolver"
"github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored"
@@ -295,7 +296,7 @@ func TestHijackHTTP(t *testing.T) {
if err == nil {
t.Fatal("expected an error here")
}
var exitErr *exec.ExitError
var exitErr *execabs.ExitError
if !errors.As(err, &exitErr) {
t.Fatal("not the error type we expected")
}
@@ -335,7 +336,7 @@ func TestHijackHTTPS(t *testing.T) {
t.Fatal("expected an error here")
}
t.Log(err)
var exitErr *exec.ExitError
var exitErr *execabs.ExitError
if !errors.As(err, &exitErr) {
t.Fatal("not the error type we expected")
}