https://github.com/lrwx00t/golive
Real-time Go development
https://github.com/lrwx00t/golive
cli go golang golive
Last synced: 9 months ago
JSON representation
Real-time Go development
- Host: GitHub
- URL: https://github.com/lrwx00t/golive
- Owner: lrwx00t
- Created: 2023-02-20T19:40:15.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-21T19:56:36.000Z (over 3 years ago)
- Last Synced: 2024-06-21T17:05:07.783Z (about 2 years ago)
- Topics: cli, go, golang, golive
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# golive
`golive` is a tool for real-time Go development, allowing you to watch changes in your `go` code execution as you make them. It automatically runs your code as you work and keeps everything in sync. It currently provides limited support to `go run` only for short and long running processes. So `golive` would be able to handle even processes that don't complete or its completion is unknown e.g. web servers, background jobs or network services.
Whenever a change is detected in the directory, such as an updated or newly added file, the code will be executed automatically. If the execution is successful, the output will be displayed in green, otherwise any errors that occurred will be displayed in red. In all cases, *`golive` is expected to continue running indefinitely until manually terminated* by issuing a `SIGINT` signal e.g. `Ctrl + C`.
### short-running process

### long-running process

## Future Note
`go run` should be replaced in the future by using `go build` and binary run to capture the actual `pid` of the process. At this time, `golive` uses a hack to filter out processes and kill any process that matches the `go run` process execution except the parent process (`golive` itself in this case).
## Install
```bash
go install github.com/lrwx00t/golive
```
## Example
```bash
golive --path ~/src/go-dev/playground/demo
2023/02/20 16:25:36 golive started 👀..
# without any arguments, it defaults to current path
golive
```