-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version devel go1.19-0ab71cc065 Thu May 26 04:57:33 2022 +0000 linux/amd64
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="" GOCACHE="/home/arccy/.cache/go-build" GOENV="/home/arccy/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/arccy/.data/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/arccy/.data/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/arccy/sdk/gotip" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/arccy/sdk/gotip/pkg/tool/linux_amd64" GOVCS="" GOVERSION="devel go1.19-0ab71cc065 Thu May 26 04:57:33 2022 +0000" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/arccy/tmp/testrepo-905/a/go.mod" GOWORK="/home/arccy/tmp/testrepo-905/go.work" 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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4081894270=/tmp/go-build -gno-record-gcc-switches"
What did you do?
with the following directory tree:
.
├── a
│ ├── b
│ │ └── doc.go
│ └── go.mod
└── go.work
run go work use . in a/b
What did you expect to see?
module defined at a/go.mod added to go.work
What did you see instead?
nothing happened (see also #51965)
notes
go help work use says usage: go work use [-r] moddirs,
but it would be more ergonomic to have go look upwards for the moddir,
essentially: go work use $(dirname $(go env GOMOD))
Metadata
Metadata
Assignees
Labels
GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.