Closed
Description
What version of Go are you using (go version
)?
bash-3.2$ go version
go version go1.11 darwin/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env
)?
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/xubei1/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xubei1/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/xubei1/go/src/github.com/go"
GOTMPDIR=""
GOTOOLDIR="/Users/xubei1/go/src/github.com/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9q/jxm70wvj5k54t2180nr604_c0000gp/T/go-build544006408=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
$ export GOCACHE=/go/src/github.com/go/cache
$ mkdir -p $GOCACHE/11
$ go clean -cache -n
cd /go/src/github.com/go/src
rm -f src.test src.test.exe
rm -r /go/src/github.com/go/cache/11
What did you expect to see?
$ ls $GOCACHE/11
/go/src/github.com/go/cache/11
What did you see instead?
$ ls $GOCACHE/11
ls: /go/src/github.com/go/cache/11: No such file or directory
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
clean: "go clean -n -cache" should respect "-n" option
clean: clean cache with -n should only print remove commands.
gopherbot commentedon Sep 3, 2018
Change https://golang.org/cl/133055 mentions this issue:
clean: clean cache with -n should only print remove commands.
andybons commentedon Sep 4, 2018
@bcmills @rsc
clean: clean cache with -n should only print remove commands.
[-]cmd/go: `go clean -n -cache` should not remove caches but print remove commands[/-][+]cmd/go: clean -n -cache should only print cache removal commands, not run them[/+]