Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when building getting error that there is " no Go files in /home/.. " and does not detects in the subdirectory #724

Open
aleks20905 opened this issue Dec 28, 2024 · 4 comments

Comments

@aleks20905
Copy link

im using Go: 1.23.4 Air: 1.61.5 OS: nixos

After updating to version 1.61.5 of air, I encountered an issue where the main.go file is not detected when it is located in a subdirectory ./cmd. However, since the update, air fails to start or build the application unless the main.go file is moved to the root directory of the project.

The only workaround I’ve found is to move the main.go file from the cmd folder to the root of the project.

and to the air.toml i have only changed : cmd = "templ generate && go build -o tmp/main ./cmd"

@AsadSaleh
Copy link

I'm having the same issue.

Go version go1.23.4 darwin/arm64
Air version v1.61.5, built with Go go1.23.4
Macbook Pro M1 Sonoma 14.5 (23F79)

@tskoyo
Copy link

tskoyo commented Jan 1, 2025

Have you tried this command: cmd = "go build -o tmp/main -buildvcs=false ./cmd"

@AsadSaleh
Copy link

AsadSaleh commented Jan 1, 2025

Have you tried this command: cmd = "go build -o tmp/main -buildvcs=false ./cmd"

Haven't tried it.

However I solved the issue by moving my main.go file to the project's root directory. Now it's working as expected 👍

@aleks20905
Copy link
Author

What is the connection between the problem and -buildvcs=false buildvcs its just metadata embedding.

I updated to version 1.61.5 of air and started encountering this issue then downgraded to 1.61.4, but the problem persisted. Before 1.61.1, I didn't have any problems, and I haven't tried versions 1.61.2 or 1.61.3.

I havent looked very closely into the matter. Where and when exactly the problem started but still i know that. It seems like something specific changed after 1.61.1+ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants