@@ -19,14 +19,14 @@ package golden
19
19
import (
20
20
"bytes"
21
21
"context"
22
+ "fmt"
22
23
"io/ioutil"
23
24
"os"
24
25
"os/exec"
25
26
"path/filepath"
26
27
"strings"
27
28
"testing"
28
29
29
- "golang.org/x/xerrors"
30
30
"k8s.io/apimachinery/pkg/api/meta"
31
31
"k8s.io/apimachinery/pkg/runtime"
32
32
"k8s.io/apimachinery/pkg/runtime/serializer/json"
@@ -294,30 +294,30 @@ func diffFiles(t *testing.T, expectedPath, actual string) error {
294
294
295
295
actualTmp , err := writeTmp (actual )
296
296
if err != nil {
297
- return xerrors .Errorf ("write actual yaml to temp file failed: %w" , err )
297
+ return fmt .Errorf ("write actual yaml to temp file failed: %w" , err )
298
298
}
299
299
t .Logf ("Wrote actual to %s" , actualTmp )
300
300
301
301
// pls to use unified diffs, kthxbai?
302
302
cmd := exec .Command ("diff" , "-u" , expectedPath , actualTmp )
303
303
stdout , err := cmd .StdoutPipe ()
304
304
if err != nil {
305
- return xerrors .Errorf ("set up stdout pipe from diff failed: %w" , err )
305
+ return fmt .Errorf ("set up stdout pipe from diff failed: %w" , err )
306
306
}
307
307
308
308
if err := cmd .Start (); err != nil {
309
- return xerrors .Errorf ("start command failed: %w" , err )
309
+ return fmt .Errorf ("start command failed: %w" , err )
310
310
}
311
311
312
312
diff , err := ioutil .ReadAll (stdout )
313
313
if err != nil {
314
- return xerrors .Errorf ("read from diff stdout failed: %w" , err )
314
+ return fmt .Errorf ("read from diff stdout failed: %w" , err )
315
315
}
316
316
317
317
if err := cmd .Wait (); err != nil {
318
318
exitErr , ok := err .(* exec.ExitError )
319
319
if ! ok {
320
- return xerrors .Errorf ("wait for command to finish failed: %w" , err )
320
+ return fmt .Errorf ("wait for command to finish failed: %w" , err )
321
321
}
322
322
t .Logf ("Diff exited %s" , exitErr )
323
323
}
0 commit comments