go-timeout
timeout is a Go port of GNU Coreutils timeout.
It starts a command, waits for a duration, and terminates the command if it is
still running.
Usage
timeout [OPTION]... DURATION COMMAND [ARG]...
Examples:
timeout 5s sleep 10
timeout --signal=KILL 1s long-running-command
timeout --kill-after=2s 5s command-that-may-ignore-term
Supported options:
-f, --foreground
-k DURATION, --kill-after=DURATION
-p, --preserve-status
-s SIGNAL, --signal=SIGNAL
-v, --verbose
--help
--version
Install
Install from source:
go install github.com/KEINOS/go-timeout/cmd/timeout@latest
Or build the local checkout:
make build
The local binary is written to:
dist/timeout
Usage as a Library
The implementation lives in the timeout package and can be used from Go code.
See CONTRIBUTING.md for the repository layout and
development notes.
Contributing
Issues and bug reports are welcome:
https://github.com/KEINOS/go-timeout/issues
Before sending changes, run:
make check-full
License
GPL-3.0. See LICENSE.txt.