Skip to content

cmd/go: clean -n -cache should only print cache removal commands, not run them #27469

Closed
@xiaoxubeii

Description

@xiaoxubeii

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

Activity

added 2 commits that reference this issue on Sep 3, 2018
fd959ab
948dc1c
gopherbot

gopherbot commented on Sep 3, 2018

@gopherbot
Contributor

Change https://golang.org/cl/133055 mentions this issue: clean: clean cache with -n should only print remove commands.

added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Sep 4, 2018
added this to the Unplanned milestone on Sep 4, 2018
andybons

andybons commented on Sep 4, 2018

@andybons
Member
added a commit that references this issue on Sep 6, 2018
97f7964
modified the milestones: Unplanned, Go1.12 on Sep 11, 2018
changed the title [-]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[/+] on Oct 24, 2018
modified the milestones: Go1.12, Go1.13 on Feb 12, 2019
locked and limited conversation to collaborators on Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.modules

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @andybons@xiaoxubeii@bcmills@gopherbot

        Issue actions

          cmd/go: clean -n -cache should only print cache removal commands, not run them · Issue #27469 · golang/go