You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess there's no main module when GOMOD=/dev/null. I believe that you can still do go build file.go, but not go build . Maybe goimports should be able to handle it as well as the go command itself does? I think that would mean scanning the module cache, but nothing else.
If GO111MODULE=on but there's no go.mod, GOMOD will be set to /dev/null
or NUL and there will be no main module. goimports should handle this
case roughly the same way the go command does.
Fixesgolang/go#30855
Change-Id: I6fbf4c056000db5abd8788a6014ae5f13b1c8cd4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/167860
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
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?
bar.go
What did you expect to see?
bar.go
What did you see instead?
creating a
go.mod
which looks like:Fixes the panic
The text was updated successfully, but these errors were encountered: