Files
via/internal/examples/livereload
Ryan Hamamura 50e368f47b
All checks were successful
CI / Build and Test (push) Successful in 38s
CI / Build and Test (pull_request) Successful in 33s
fix: nil-close bug, stale docs, dead code, and tracked binaries
- Fix potential nil file.Close() panic in devModePersist/devModeRemovePersisted
  by extracting loadDevModeMap/saveDevModeMap helpers with proper defer
- Remove tracked binaries (pathparams 10.8 MB, shake.db 22 MB) and consolidate
  .gitignore with a wildcard pattern covering all 19 examples
- Remove stale reaper reference in README (removed in dc56261), update example
  count from 14 to 19, fix OnChange debounce claim in docs
- Fix typos: "percist"→"persist", "percisted"→"persisted", "tmplates"→"templates"
- Remove dead code: commented import in signal_test.go, unnecessary fmt.Sprintf
  in computed.go, commented picocss imports and no-op Config calls in examples
- Replace go fmt with gofmt -l check in ci-check.sh to fail on unformatted code
  instead of silently reformatting
2026-02-20 09:58:46 -10:00
..
2025-11-08 13:05:23 -05:00
2025-11-08 13:05:23 -05:00

Live Reload with Air

Hot-reloads your Go code and web page.

Setup

If you don't have Air yet:

go install github.com/air-verse/air@latest

Run

air

Then open http://localhost:3000 in your browser.

How It Works

Air watches your Go files and rebuilds when you make changes.

LiveReloadPlugin handles browser refresh through a SSE connection at /dev/reload. When Air restarts the server, the connection drops, triggering an automatic page reload after 100ms. This only runs on localhost.

Files

  • .air.toml - Air config
  • livereload.go - Via plugin for browser auto-reload