profile
viewpoint

Ask questionscmd/go: `go clean <package>` downloads modules

#28680 is fixed and go clean --modcache command no longer donwloads modules before cleaning if no argument is given to the command.

Note however 'go clean' accepts packages parameter as an argument(which isn't relevant to -modcache but is still meaningful for other purposes of go clean). If they are given, go clean still downloads the modules and even updates the go.mod file.

<pre> $ go help clean usage: go clean [clean flags] [build flags] [packages] ... $ export GOPATH=$(mktemp -d) $ go1.13beta1 clean -testcache -cache -modcache $ go1.13beta1 mod init scratch go: creating new go.mod: module scratch $ go1.13beta1 clean golang.org/x/text go: finding golang.org/x/text v0.3.2 go: downloading golang.org/x/text v0.3.2 go: extracting golang.org/x/text v0.3.2 $ cat go.mod module scratch

go 1.13

require golang.org/x/text v0.3.2 // indirect </pre>

And the go clean -modcache <package> behaves differently. <pre> $ go1.13beta1 clean -modcache golang.org/x/text $ go1.13beta1 clean -modcache golang.org/x/text go: downloading golang.org/x/text v0.3.2 go: extracting golang.org/x/text v0.3.2 go: finding golang.org/x/text v0.3.2 </pre>

golang/go

Answer questions bcmills

@hitzhangjie, that seems mostly unrelated to the issue reported here. If you are seeing something you believe to be a regression, please file a new issue with complete steps to reproduce it.

useful!

Related questions

cmd/link: segmentation fault during mach-o linking
cmd/go: cannot find module providing package error stops `go get` processing hot 3
vendor/golang.org/x/xerrors/adaptor_go1_13.go:16:14: undefined: errors.Frame ... hot 2
cmd/vet: potential false positive in the "suspect or" check hot 2
cmd/go: needs a better error than "missing dot in first path element" when GOROOT is set incorrectly hot 2
x/xerrors: fails to compile on tip hot 1
cmd/cgo error: runtime: unknown pc 0x7fff5c805b86 hot 1
runtime: crash with "invalid pc-encoded table" hot 1
cmd/link: showing many ld warnings of "building for macOS, but linking in object file" hot 1
runtime: go program crach, it seems fall into infinite loop hot 1
cmd/go: major version without preceding tag must be v0, not v1 - breaks build of github.com/go-check hot 1
gollvm: Using External Go Packages with gollvm hot 1
runtime: macOS Sierra builders spinning hot 1
cmd/go: Problem using go modules hot 1
cmd/go: "unrecognized import path" for local packages after updating to go1.13 hot 1
Github User Rank List