Skip to content

cmd/go: Cannot delete files downloaded by Go module #28902

@nqv

Description

@nqv

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

$ go version
go version go1.11.2 darwin/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
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/nqv/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/nqv/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/nqv/go/go1.11.2.darwin-amd64"
GOTMPDIR=""
GOTOOLDIR="/Users/nqv/go/go1.11.2.darwin-amd64/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/tmp/quote/go.mod"
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/py/6npc2tsd1g1_l0f92l0s3760vrtpsh/T/go-build816858901=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

cd /tmp
git clone https://github.com/rsc/quote.git
cd quote
go mod download
rm -rf ~/go/pkg/mod

What did you expect to see?

go/pkg/mod (and ~/go) can be deleted from filesystem by myself.

What did you see instead?

rm: /Users/nqv/go/pkg/mod/.../<FILE_NAME>.go: Permission denied

Looks like all files under /go/pkg/mod have permission 0444

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions