Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrmarble/exec
Similar to os/exec but without waiting for child process
https://github.com/mrmarble/exec
child-process fork proccess
Last synced: about 1 month ago
JSON representation
Similar to os/exec but without waiting for child process
- Host: GitHub
- URL: https://github.com/mrmarble/exec
- Owner: MrMarble
- License: unlicense
- Created: 2024-01-18T23:14:55.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-26T19:05:27.000Z (11 months ago)
- Last Synced: 2024-06-21T19:55:58.475Z (6 months ago)
- Topics: child-process, fork, proccess
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# exec Package
[![Go Reference](https://pkg.go.dev/badge/github.com/mrmarble/exec.svg)](https://pkg.go.dev/github.com/mrmarble/exec)
[![Go Report Card](https://goreportcard.com/badge/github.com/mrmarble/exec)](https://goreportcard.com/report/github.com/mrmarble/exec)
[![Tests](https://github.com/MrMarble/exec/actions/workflows/go.yml/badge.svg)](https://github.com/MrMarble/exec/actions/workflows/go.yml)The `exec` package in Go is designed to run external commands. It is similar to the `os/exec` package, but provides a simpler interface and does not support streaming.
## Main Features
- The main difference between `exec` and `os/exec` is that the process does not wait for child processes to finish. This is useful for running long-running processes that are expected to run in the background.
## Example
```go
out, err := exec.Command("date").Output()
if err != nil {
log.Fatal(err)
}
fmt.Printf("The date is %s\n", out)
```This example runs the `date` command and logs any errors that occur.