gostructor

Hot reload from a file (no Docker)

The simplest live-config demo: gostructor.Watch + a gostructor/watch fsnotify file source. Edit a JSON file, the struct re-fills.

go run .

Then, in another terminal, edit config.json and save. You’ll see:

✅ config now: 127.0.0.1:8080  message="edit me and save"
✅ config now: 127.0.0.1:9090  message="changed!"

Try a bad edit — set "port": 70000, or write invalid JSON. The reload is rejected and the previous good config keeps serving:

⚠️  reload rejected, keeping last good config: port 70000 out of range 1..65535

What it shows