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

cmd/go: work use . does nothing in non module root #53090

Open
seankhliao opened this issue May 26, 2022 · 0 comments
Open

cmd/go: work use . does nothing in non module root #53090

seankhliao opened this issue May 26, 2022 · 0 comments
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@seankhliao
Copy link
Member

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))

cc @bcmills @matloob

@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels May 26, 2022
@seankhliao seankhliao changed the title cmd/go: work use . does nothing in cmd/go: work use . does nothing in non module root May 26, 2022
@seankhliao seankhliao added this to the Unplanned milestone Aug 20, 2022
@bcmills bcmills modified the milestones: Unplanned, Backlog Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants