Skip to content

Commit

Permalink
remove redundant else
Browse files Browse the repository at this point in the history
  • Loading branch information
leongross committed Nov 4, 2024
1 parent 664c581 commit 94e8652
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 30 deletions.
18 changes: 9 additions & 9 deletions src/os/exec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)

if err != nil {
return 0, err
} else {
// else code runs in child, which then should exec the new process
err = execve(argv0, argv, attr.Env)
if err != nil {
// exec failed
return 0, err
}
// 3. TODO: use pipes to communicate back child status
return pid, nil
}

// else code runs in child, which then should exec the new process
err = execve(argv0, argv, attr.Env)
if err != nil {
// exec failed
return 0, err
}
// 3. TODO: use pipes to communicate back child status
return pid, nil
}

// In Golang, the idiomatic way to create a new process is to use the StartProcess function.
Expand Down
Binary file removed src/os/os.test
Binary file not shown.
3 changes: 0 additions & 3 deletions src/os/osexec.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
//go:build linux && !baremetal && !tinygo.wasm

// arm64 does not have a fork syscall, so ignore it for now
// TODO: add support for arm64 with clone or use musl implementation

package os

import (
Expand Down
18 changes: 0 additions & 18 deletions src/os/osexec_aarch64.go

This file was deleted.

0 comments on commit 94e8652

Please sign in to comment.