v0.1.2

Hot Reload

This page explains how go-rest-client watches the .http file and reloads the request list after you save.

Triggers

On startup, fsnotify watches the file given on the command line. A fsnotify.Write or fsnotify.Create event starts a 200ms timer; any further event during that window resets it, so a burst of editor writes triggers only one reload. fsnotify.Remove, fsnotify.Rename, and fsnotify.Chmod events do not trigger a reload.

Reload Flow

Stage Hint bar Description
Start Yellow Edited at HH:MM:SS Timer fired
Parse — ReadFile re-parses the whole file
Success Green Reloaded at HH:MM:SS List refreshed; cursor returns to the previous index (first item if the new list is shorter)
Failure Red error at HH:MM:SS List and info pane keep their pre-reload content

The cursor is restored by index, not by request name: inserting or deleting requests above the current one moves the cursor to a different request.

Watch Errors

Errors reported by fsnotify appear in the hint bar as red Watch error: ..., and the program keeps running.

Editor Compatibility

Only fsnotify.Write/fsnotify.Create are handled, and a single file path is watched. Editors that save by writing a temp file and renaming it over the original cause a fsnotify.Rename or fsnotify.Remove on the watched file; the watch is not re-added, so later edits stop triggering reloads. Restart gorc when this happens. See Known Limitations.

中文