-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
FrozenDueToAgeGoCommandcmd/gocmd/goNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.SuggestedIssues that may be good for new contributors looking for work to do.Issues that may be good for new contributors looking for work to do.
Description
What version of Go are you using (go version
)?
$ go version 1.18
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="/home/ja/go/bin" GOCACHE="/home/ja/.cache/go-build" GOENV="/home/ja/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/ja/go/pkg/mod" GONOPROXY="*" GONOSUMDB="*" GOOS="linux" GOPATH="/home/ja/go" GOPRIVATE="*" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/ja/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/ja/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.18" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4125566826=/tmp/go-build -gno-record-gcc-switches"
What did you do?
$ mkdir work $ cd work $ go work init $ touch iamafile $ go work use iamafile
What did you expect to see?
A graceful error around having been provided a file instead of a folder
What did you see instead?
go: stat /home/ja/work/iamafile/go.mod: not a directory panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x81d565] goroutine 1 [running]: cmd/go/internal/workcmd.runUse.func1({0x7ffc8a10a7ed?, 0x0?}) /usr/local/go/src/cmd/go/internal/workcmd/use.go:97 +0x165 cmd/go/internal/workcmd.runUse({0xadc718?, 0xc000122000?}, 0xc00014c510?, {0xc00013a030, 0x1, 0x2?}) /usr/local/go/src/cmd/go/internal/workcmd/use.go:112 +0xa8a main.invoke(0xdb7660, {0xc00013a020, 0x2, 0x2}) /usr/local/go/src/cmd/go/main.go:218 +0x2ee main.main() /usr/local/go/src/cmd/go/main.go:175 +0x78e
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeGoCommandcmd/gocmd/goNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.SuggestedIssues that may be good for new contributors looking for work to do.Issues that may be good for new contributors looking for work to do.