HaoweiCh / autoRestart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoDoc

Lightweight automatic reloading of Go processes.

After initialization with autoRestart.Watch() any changes to the binary (and only the binary) will restart the process.

This is an alternative to the "restart binary after any *.go file changed"-strategy that some other projects – such as gin or go-watcher – take.

The advantage of this project's approach is that you have a more control over when the process restarts, and it only watches a single directory for changes which has some performance benefits, especially when used over NFS or Docker with a large number of files.

It also means you won't start a whole bunch of builds if you update 20 files in a quick succession. On a desktop this probably isn't a huge deal, but on a laptop it'll save some battery power.

Because it's in-process you can also do things like reloading just templates instead of recompiling/restarting everything.

this repo is customized

About


Languages

Language:Go 100.0%