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

[Bug] go build failed with malformed import path on Windows #229

Open
y1yang0 opened this issue Nov 27, 2024 · 0 comments
Open

[Bug] go build failed with malformed import path on Windows #229

y1yang0 opened this issue Nov 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@y1yang0
Copy link
Member

y1yang0 commented Nov 27, 2024

Currently, we locate the go.mod file using methods like go env GOMOD, which we consider a clever approach. However, it is not completely accurate. In some special cases, go build might execute outside of the user's source code, and in such scenarios, we might end up finding the incorrect go.mod file and consequently retrieve the wrong module name. I believe we should reference the Golang build process code and specifically use code similar to the following to search for go.mod

https://github.com/golang/go/blob/485ed2fa5b5e0b7067ef72a0f4bdc9ca12b77ed7/src/cmd/go/internal/modload/init.go#L1598

@y1yang0 y1yang0 added the bug Something isn't working label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant