Skip to content

cmd/go: unexpected dependencies are added #30206

@mwf

Description

@mwf

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

$ go version
go version go1.12rc1 darwin/amd64

Does this issue reproduce with the latest release?

Yes, it's reproduced both in go1.11.5 and latest go1.12rc1

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ikorolev/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ikorolev/.gvm/pkgsets/go1.12rc1/global"
GOPROXY=""
GORACE=""
GOROOT="/Users/ikorolev/.gvm/gos/go1.12rc1"
GOTMPDIR=""
GOTOOLDIR="/Users/ikorolev/.gvm/gos/go1.12rc1/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/var/folders/_b/d1934m9s587_8t_6ngv3hnc00000gp/T/tmp.8KAivHiQ/radix/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/_b/d1934m9s587_8t_6ngv3hnc00000gp/T/go-build143042786=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

cd `mktemp -d`
git clone [email protected]:mediocregopher/radix.git
cd radix
go mod tidy

What did you expect to see?

I expect no significant modifications in go.mod and go.sum

What did you see instead?

go.mod diff:

diff --git a/go.mod b/go.mod
index bca20e2..e6f9944 100644
--- a/go.mod
+++ b/go.mod
@@ -2,10 +2,12 @@ module github.com/mediocregopher/radix/v3

 require (
        github.com/davecgh/go-spew v1.1.1 // indirect
+       github.com/garyburd/redigo v1.6.0 // indirect
        github.com/gomodule/redigo v2.0.0+incompatible
        github.com/joomcode/errorx v0.1.0 // indirect
-       github.com/joomcode/redispipe v0.9.0 // indirect
+       github.com/joomcode/redispipe v0.9.0
        github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed
+       github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9 // indirect
        github.com/pmezard/go-difflib v1.0.0 // indirect
        github.com/stretchr/testify v1.2.2
 )

I can't understand the reason why github.com/garyburd/redigo and github.com/mediocregopher/radix.v2 appear in go.mod

go mod why reasonably tells me (main module does not need package <...>).

If they are not used anywhere, how could the appear in the dependency graph?

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