@@ -341,8 +341,7 @@ func emuCheck(t *testing.T, options compileopts.Options) {
341
341
}
342
342
if spec .Emulator != "" {
343
343
emulatorCommand := strings .SplitN (spec .Emulator , " " , 2 )[0 ]
344
- _ , err := exec .LookPath (emulatorCommand )
345
- if err != nil {
344
+ if _ , err := exec .LookPath (emulatorCommand ); err != nil {
346
345
if errors .Is (err , exec .ErrNotFound ) {
347
346
t .Skipf ("emulator not installed: %q" , emulatorCommand )
348
347
}
@@ -672,8 +671,7 @@ func TestWasmExport(t *testing.T) {
672
671
builder := r .NewHostModuleBuilder ("tester" )
673
672
builder .NewFunctionBuilder ().WithFunc (callOutside ).Export ("callOutside" )
674
673
builder .NewFunctionBuilder ().WithFunc (callTestMain ).Export ("callTestMain" )
675
- _ , err = builder .Instantiate (ctx )
676
- if err != nil {
674
+ if _ , err = builder .Instantiate (ctx ); err != nil {
677
675
t .Fatal (err )
678
676
}
679
677
@@ -730,8 +728,7 @@ func TestWasmFuncOf(t *testing.T) {
730
728
cmd := exec .Command ("node" , "testdata/wasmfunc.js" , result .Binary , buildConfig .BuildMode ())
731
729
cmd .Stdout = output
732
730
cmd .Stderr = output
733
- err = cmd .Run ()
734
- if err != nil {
731
+ if err = cmd .Run (); err != nil {
735
732
t .Error ("failed to run node:" , err )
736
733
}
737
734
checkOutput (t , "testdata/wasmfunc.txt" , output .Bytes ())
@@ -771,8 +768,8 @@ func TestWasmExportJS(t *testing.T) {
771
768
cmd := exec .Command ("node" , "testdata/wasmexport.js" , result .Binary , buildConfig .BuildMode ())
772
769
cmd .Stdout = output
773
770
cmd .Stderr = output
774
- err = cmd . Run ()
775
- if err != nil {
771
+
772
+ if err = cmd . Run (); err != nil {
776
773
t .Error ("failed to run node:" , err )
777
774
}
778
775
checkOutput (t , "testdata/wasmexport.txt" , output .Bytes ())
@@ -1037,8 +1034,7 @@ func TestMain(m *testing.M) {
1037
1034
switch os .Args [1 ] {
1038
1035
case "clang" , "ld.lld" , "wasm-ld" :
1039
1036
// Invoke a specific tool.
1040
- err := builder .RunTool (os .Args [1 ], os .Args [2 :]... )
1041
- if err != nil {
1037
+ if err := builder .RunTool (os .Args [1 ], os .Args [2 :]... ); err != nil {
1042
1038
// The tool should have printed an error message already.
1043
1039
// Don't print another error message here.
1044
1040
os .Exit (1 )
0 commit comments