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
commit 18ca6d5f35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 20 deletions

View file

@ -10,11 +10,12 @@ import (
"net"
"net/http"
"os"
"os/exec"
"os/signal"
"strings"
"syscall"
"golang.org/x/sys/execabs"
"github.com/apex/log"
"github.com/apex/log/handlers/cli"
"github.com/miekg/dns"
@ -243,7 +244,7 @@ func mustx(err error, message string, osExit func(int)) {
if err != nil {
var (
exitcode = 1
exiterr *exec.ExitError
exiterr *execabs.ExitError
)
if errors.As(err, &exiterr) {
exitcode = exiterr.ExitCode()