Skip to content

Commit 38068bf

Browse files
committed
nit: update main_test.go
Signed-off-by: leongross <leon.gross@9elements.com>
1 parent 2e04cc2 commit 38068bf

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

main_test.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,7 @@ func emuCheck(t *testing.T, options compileopts.Options) {
340340
}
341341
if spec.Emulator != "" {
342342
emulatorCommand := strings.SplitN(spec.Emulator, " ", 2)[0]
343-
_, err := exec.LookPath(emulatorCommand)
344-
if err != nil {
343+
if _, err := exec.LookPath(emulatorCommand); err != nil {
345344
if errors.Is(err, exec.ErrNotFound) {
346345
t.Skipf("emulator not installed: %q", emulatorCommand)
347346
}
@@ -685,8 +684,7 @@ func TestWasmExport(t *testing.T) {
685684
builder := r.NewHostModuleBuilder("tester")
686685
builder.NewFunctionBuilder().WithFunc(callOutside).Export("callOutside")
687686
builder.NewFunctionBuilder().WithFunc(callTestMain).Export("callTestMain")
688-
_, err = builder.Instantiate(ctx)
689-
if err != nil {
687+
if _, err = builder.Instantiate(ctx); err != nil {
690688
t.Fatal(err)
691689
}
692690

@@ -743,8 +741,7 @@ func TestWasmFuncOf(t *testing.T) {
743741
cmd := exec.Command("node", "testdata/wasmfunc.js", result.Binary, buildConfig.BuildMode())
744742
cmd.Stdout = output
745743
cmd.Stderr = output
746-
err = cmd.Run()
747-
if err != nil {
744+
if err = cmd.Run(); err != nil {
748745
t.Error("failed to run node:", err)
749746
}
750747
checkOutput(t, "testdata/wasmfunc.txt", output.Bytes())
@@ -784,8 +781,8 @@ func TestWasmExportJS(t *testing.T) {
784781
cmd := exec.Command("node", "testdata/wasmexport.js", result.Binary, buildConfig.BuildMode())
785782
cmd.Stdout = output
786783
cmd.Stderr = output
787-
err = cmd.Run()
788-
if err != nil {
784+
785+
if err = cmd.Run(); err != nil {
789786
t.Error("failed to run node:", err)
790787
}
791788
checkOutput(t, "testdata/wasmexport.txt", output.Bytes())
@@ -1050,8 +1047,7 @@ func TestMain(m *testing.M) {
10501047
switch os.Args[1] {
10511048
case "clang", "ld.lld", "wasm-ld":
10521049
// Invoke a specific tool.
1053-
err := builder.RunTool(os.Args[1], os.Args[2:]...)
1054-
if err != nil {
1050+
if err := builder.RunTool(os.Args[1], os.Args[2:]...); err != nil {
10551051
// The tool should have printed an error message already.
10561052
// Don't print another error message here.
10571053
os.Exit(1)

0 commit comments

Comments
 (0)