test(update): use errors.As in the check adapter harness
This commit is contained in:
1 parent
e8a17ad21b
commit
7668f473b5
1 file changed
+3
-1
@@ -2,6 +2,7 @@ package releaseupdate
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -62,7 +63,8 @@ func runUpdateCheckScript(t *testing.T, run checkRun) (Snapshot, []string, strin
|
||||
)
|
||||
output, err := cmd.Output()
|
||||
var stderr string
|
||||
if exitErr, ok := err.(*exec.ExitError); ok {
|
||||
var exitErr *exec.ExitError
|
||||
if errors.As(err, &exitErr) {
|
||||
stderr = string(exitErr.Stderr)
|
||||
}
|
||||
var calls []string
|
||||
|
||||
Reference in new issue
Block a user