Open noloman opened 4 months ago
You probably figured it out, but you most likely just have to configure the air.toml (in root dir) to run go build -o temp/main cmd/api/main.go
instead of what's the default.
And if you have multiple go files in the directory, point it to the entire directory, not just the main.go file, i.e. go build -o ./tmp/main ./cmd/api
. @cosmtrek I think this should be included in the FAQ section, under "What to do if my go files are not in the root directory?". I have spent a good amount of time trying to figure it out because I'm a total newbie. I bet there will be more people looking for that in the future. Thanks.
Hi,
I'm not sure how to properly run air in my project:
I have a root folder which contains the following folders:
Without air, I'd normally run my project with
go run /cmd/api
.If I run
air init
in the root folder, I always get:However, if I run it into the
/cmd/api
which is where mymain.go
file is, it works fine EXCEPT that if I modify any file outside of/cmd/api
, then air doesn't pick up those changes.How can I properly set up and run air so that it monitors all my changes?
Thanks!