Open Script20 opened 6 months ago
I just had this issue while doing the same course. It's not related to Air - instead, the .air.toml
file needs adjustment for Windows.
I modified lines 7 and 8 of the air.toml
to look like the following:
bin = ".\tmp\main.exe"
cmd = "go build -o '.\tmp\main.exe' 'cmd\main.go'"
What I changed:
cmd
, i.e. ./tmp/main
becomes './tmp.main'
'./tmp/main'
becomes '.\tmp\main'
main
to main.exe
in both linesIf you're still running into issues, first check that you can run the contents of cmd
separately in your terminal, i.e. run
go build -o '.\tmp\main.exe' 'cmd\main.go'
If you get errors here, there are likely errors in your main.go
file. (Also, make sure it's actually in the cmd
folder and not in a subfolder.)
This worked for me on Windows 11
bin = "./tmp/main.exe"
cmd = "go build -o ./tmp/main.exe cmd/main.go"
I have go and htmx project and when I try and start air it doesn't crashes as shown in image below. I have seen in a issue if you put "start" in "full_bin" it will work but that doesn't work for me.
My air toml: