Skip to content

x/vgo: do not add refs to non-module v2.0.0 during go.mod auto-creation #24585

@fishy

Description

@fishy

Please answer these questions before submitting your issue. Thanks!

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

go version go1.10 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"

What did you do?

The repo to reproduce this issue is https://github.com/fishy/gcsbucket (at time of reporting, HEAD is at 618d60fe84e06f5e695a7be52566b40d198191a5). It imports cloud.google.com/go/storage (and also github.com/fishy/fsdb, but that one doesn't have any other 3rd party dependencies).

Running vgo build the first time builds successfully, generating go.mod file:

module "github.com/fishy/gcsbucket"

require (
        "cloud.google.com/go" v0.0.0-20180119154837-767c40d6a2e0
        "github.com/fishy/fsdb" v0.0.0-20180217030800-5527ded01371
        "github.com/golang/protobuf" v1.0.0
        "github.com/googleapis/gax-go" v2.0.0
        "golang.org/x/net" v0.0.0-20180216171745-136a25c244d3
        "golang.org/x/oauth2" v0.0.0-20180207181906-543e37812f10
        "golang.org/x/text" v0.0.0-20180208041248-4e4a3210bb54
        "google.golang.org/api" v0.0.0-20180217000815-c7a403bb5fe1
        "google.golang.org/appengine" v1.0.0
        "google.golang.org/genproto" v0.0.0-20180206005123-2b5a72b8730b
        "google.golang.org/grpc" v1.10.0
)

Then running vgo build again will complain about:

vgo: errors parsing go.mod:
/Users/fishy/work/gopath/src/github.com/fishy/gcsbucket/go.mod:7: invalid module: github.com/googleapis/gax-go should be v1, not v2 (v2.0.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions