air
air copied to clipboard
Support "replace" directive in go.mod with external replacement-path
Go projects can leverage the "replace" directive in go.mod to swap an imported module for a local copy.
Example from the gomod-ref docs:
replace example.com/othermodule => ../othermodule
This pattern is often used when you need to make an update to othermodule so you modify a local copy on disk to test your changes first in your consuming project.
It would be an awesome developer experience if air had an option to detect replace directives in go.mod files (for external directories with a default pattern of files to watch) so a project can automatically reload.
cc @justinrixx
One tip for this is if you place your modules in the same directory, and run air from the root of that directory it will watch everything above it.
Example, if you ran air
from your home/ || ~/ directory it would watch all files in your home directory.
https://github.com/cosmtrek/air/issues/60