Skip to content

go work: init adds directories in a format edit can't understand #51619

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

Closed
zellyn opened this issue Mar 11, 2022 · 1 comment
Closed

go work: init adds directories in a format edit can't understand #51619

zellyn opened this issue Mar 11, 2022 · 1 comment

Comments

@zellyn
Copy link

zellyn commented Mar 11, 2022

What version of Go are you using (go version)?

go version devel go1.18-a5c0b19 Sun Jan 30 02:29:51 2022 +0000 darwin/amd64

Does this issue reproduce with the latest release?

Not sure

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/zellyn/gh/yaml-edit/.hermit/go/bin"
GOCACHE="/Users/zellyn/Library/Caches/go-build"
GOENV="/Users/zellyn/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/zellyn/Development/go/pkg/mod"
GONOPROXY=".sqcorp.co,github.com/squareup"
GONOSUMDB="
.sqcorp.co,github.com/squareup"
GOOS="darwin"
GOPATH="/Users/zellyn/Development/go"
GOPRIVATE="*.sqcorp.co,github.com/squareup"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/zellyn/Library/Caches/hermit/pkg/go@tip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/zellyn/Library/Caches/hermit/pkg/go@tip/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="devel go1.18-a5c0b19 Sun Jan 30 02:29:51 2022 +0000"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK="/Users/zellyn/gh/yaml-edit/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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/vt/xwmzzrzs3dl3pz9d1yqtrtl80000gn/T/go-build2205153915=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ go work init
$ cat go.work
go 1.18
$ go work use -r .
$ cat go.work
go 1.18

use (
	go-yaml
	go-yaml/benchmarks
	yfix
)
$ go work edit -dropuse yfix
$ cat go.work
go 1.18

use (
	go-yaml
	go-yaml/benchmarks
	yfix
)
$ sed -i'' -e 's|yfix|./yfix|' go.work 
$ cat go.work
go 1.18

use (
	go-yaml
	go-yaml/benchmarks
	./yfix
)
$ go work edit -dropuse yfix
$ cat go.work
go 1.18

use (
	go-yaml
	go-yaml/benchmarks
)

What did you expect to see?

go work edit could remove directories

What did you see instead?

It couldn't

@seankhliao
Copy link
Member

Duplicate of #51449

Fixed on tip and release branch

@golang golang locked and limited conversation to collaborators Mar 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants