-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
cmd/go: nil pointer dereference when running "go mod tidy" in temp root #51992
Comments
I have investigated this issue. This issue would happen with Go 1.18 or higher. In Other mod commands like |
Change https://go.dev/cl/400554 mentions this issue: |
Hi all, I am still having this issue ( root@c2b53323c59c:/tmp# pwd
/tmp
root@c2b53323c59c:/tmp# ls
Dockerfile README.md conf go.mod go.sum main.go static
root@c2b53323c59c:/tmp# go version
go version go1.20.1 linux/arm64
root@c2b53323c59c:/tmp# go mod tidy
go: warning: ignoring go.mod in system temp root /tmp
go: warning: "all" matched no packages
go: go.mod file not found in current directory or any parent directory; see 'go help modules' |
Hi. The error is as intended. This issue refers to the failure to generate the error as intended, resulting in panic. |
@tenkoh What is a fix for this? |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I went to create a temporary go.mod file in
/tmp
to test something. As per https://golang.org/cl/129063,/<temp-dir>/go.mod
is generally ignored - not realising this, I rango mod tidy
and was slightly surprised to see a panic printed.What did you expect to see?
With Go 1.17 a warning is displayed, which seems reasonable:
What did you see instead?
With Go 1.18 the same warning is displayed, but there is also a panic relating to a nil pointer dereference:
The text was updated successfully, but these errors were encountered: