air icon indicating copy to clipboard operation
air copied to clipboard

Support "replace" directive in go.mod with external replacement-path

Open wburningham opened this issue 1 year ago • 3 comments

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.

wburningham avatar Jul 27 '22 19:07 wburningham

cc @justinrixx

wburningham avatar Jul 27 '22 19:07 wburningham

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.

skelouse avatar Aug 26 '22 21:08 skelouse

https://github.com/cosmtrek/air/issues/60

skelouse avatar Aug 26 '22 21:08 skelouse