Skip to content

cmd/go: go get module/pkg@master doesn't seem to work sometimes #37438

Closed
@mvdan

Description

@mvdan

Here is a standalone reproducer:

#!/bin/bash
  
docker run -i golang:1.14rc1 <<-SCRIPT

        mkdir foo
        cd foo
        go mod init test.tld/foo

        go get -d github.com/grpc-ecosystem/[email protected]
        go list -m -f {{.Version}} github.com/grpc-ecosystem/go-grpc-prometheus

        go get -d github.com/grpc-ecosystem/go-grpc-prometheus/packages/grpcstatus@master

SCRIPT

It's minified from a real situation at work. You can see that https://github.com/grpc-ecosystem/go-grpc-prometheus/tree/master/packages/grpcstatus exists at master, but it didn't exist when 1.2.0 was tagged, which is the latest release.

The output is:

go get github.com/grpc-ecosystem/go-grpc-prometheus/packages/grpcstatus@master: module github.com/grpc-ecosystem/go-grpc-prometheus@latest found (v1.2.0), but does not contain package github.com/grpc-ecosystem/go-grpc-prometheus/packages/grpcstatus

This message doesn't make sense to me. If I asked for @master, why is it settling for @latest?

If I replace the commands for go get module@master; go build module/pkg, it works:

go get -d github.com/grpc-ecosystem/go-grpc-prometheus@master
go build github.com/grpc-ecosystem/go-grpc-prometheus/packages/grpcstatus

This seems like a bug. I'm not sure what exactly is triggering it. CC @bcmills @jayconrod

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeGoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions