Skip to content
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

cmd/go: go mod does not provide access to all operations on modules #33561

Closed
psampaz opened this issue Aug 9, 2019 · 2 comments
Closed

cmd/go: go mod does not provide access to all operations on modules #33561

psampaz opened this issue Aug 9, 2019 · 2 comments

Comments

@psampaz
Copy link
Contributor

psampaz commented Aug 9, 2019

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

$ go version
go version go1.12.6 linux/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="/home/psm/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/psm/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang-1.12.6"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang-1.12.6/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build623873491=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I tried to create a list of all commands related to go modules

What did you expect to see?

I expected to see all go modules related operations beign available though "go mod" tool

What did you see instead?

Different tools providing go modules related operations:

go list -m all

go list -u -m all

go get -u

go get -u=patch

go clean -modcache

go mod tidy

go mod vendor

While this behavior is documented in go mod help:

Go mod provides access to operations on modules.

Note that support for modules is built into all the go commands,
not just 'go mod'. For example, day-to-day adding, removing, upgrading,
and downgrading of dependencies should be done using 'go get'.
See 'go help modules' for an overview of module functionality.

and even though I understand the rationale behind having modules related functionality in different tools, I believe it is very confusing especially for new Go developers that didn't follow the progress of introducing modules to the language and they are not aware of Go's tooling philosophy.

Having one point of reference for all go modules related operations will increase developer experience significantly.

@bcmills
Copy link
Contributor

bcmills commented Aug 9, 2019

@psampaz, the fact that module support is integrated into all aspects of the go command is fundamental to its design.

As it stands today, every go command that you run within a module should have a reproducible result, and if a new dependency is needed, rather than the go command telling you some exact command that you would need to run to fix the problem, it just fixes it directly.

That is not going to change at this point.

@bcmills
Copy link
Contributor

bcmills commented Aug 9, 2019

Duplicate of #27643

@bcmills bcmills marked this as a duplicate of #27643 Aug 9, 2019
@bcmills bcmills closed this as completed Aug 9, 2019
@golang golang locked and limited conversation to collaborators Aug 8, 2020
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