Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.18beta2 linux/amd64 go version devel go1.18-5fd8c9b5c5 Sat Jan 29 03:53:30 2022 +0000 linux/amd64
Does this issue reproduce with the latest release?
prerelease
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.18-5fd8c9b5c5 Sat Jan 29 03:53:30 2022 +0000" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/arccy/tmp/testrepo-771/go.mod" GOWORK="/home/arccy/tmp/testrepo-771/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4285625585=/tmp/go-build -gno-record-gcc-switches"
What did you do?
$ mkdir example && cd example
$ go mod init example
$ go work init
$ mkdir bar && cd bar
$ go mod init example/bar
$ go work use .
$ cat ../go.work
go 1.18
What did you expect to see?
Either use bar
added to go.work or an error
What did you see instead?
no entry added, no error reported