Skip to content

cmd/go: trim go.sum without adding module requirements #29800

Closed as not planned
Closed as not planned
@F21

Description

@F21

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

go version go1.11.4 linux/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="/home/user/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/go" 
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo" 
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/d/14-Workspace/go/github.com/F21/somerepo/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build348706889=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. Create go.mod: go mod init github.com/F21/somerepo.
  2. Populate go.mod and go.sum by running go test ./....
  3. One of the dependencies github.com/uber/jaeger-client-go conflicts with another dependency, so I bumped it to master: go get github.com/uber/jaeger-client-go@master.
  4. There are now 2 entries for github.com/uber/jaeger-client-go in my go.sum:
github.com/uber/jaeger-client-go v2.15.0+incompatible h1:NP3qsSqNxh8VYr956ur1N/1C1PjvOJnJykCzcD5QHbk=
github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-client-go v2.15.1-0.20190116124224-6733ee486c78+incompatible h1:b2A4zBpOpzqZoSlqlJ3OOe0yjd577TnQIHG1/KN7U8E=
github.com/uber/jaeger-client-go v2.15.1-0.20190116124224-6733ee486c78+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=

The github.com/uber/jaeger-client-go v2.15.0+incompatible entries are unnecessary as the project is now pinned to github.com/uber/jaeger-client-go v2.15.1-0.20190116124224-6733ee486c78+incompatible (current master).

In #26381, the ability to trim go.sum was added to go mod tidy. However, go mod tidy is something I avoid as it pulls in all test dependencies for all my dependencies and their dependencies for all platforms. Unfortunately, go mod tidy has burnt me quite a few times and causes a lot more problems than it solves.
See:

What did you expect to see?

I'd like to be able to trim unneeded entries from go.sum without having to run go mod tidy as its current behavior causes a lot more problems than it solves.

What did you see instead?

N/A.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.GoCommandcmd/goNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions