Is there a bug in the command "go list -deps -json ./..."?

68 views
Skip to first unread message

tapi...@gmail.com

unread,
Apr 19, 2021, 11:44:57 AM4/19/21
to golang-nuts
I checked out the kubernetes project at tag v1.20.4.
Then run "go list -deps -json ./... > json,txt" in the project root.
In the produced json.txt file, I notice that the module path for
two packages look not right. The path of a package should be
prefixed with its module path. But the two don't. Bug?

The first:

{
    "Dir": "/home/lx/mount/sda2/opensource/it-infrastructure/kubernetes/vendor/github.com/Azure/go-autorest/autorest/azure",
    "ImportPath": "github.com/Azure/go-autorest/autorest/azure",
    "Name": "azure",
    "Doc": "Package azure provides Azure-specific implementations used with AutoRest.",
    "Module": {
        "Path": "github.com/Azure/go-autorest/autorest/adal",
        "Replace": {
            "Path": "github.com/Azure/go-autorest/autorest/adal",
            "Version": "v0.9.5"
        }
    },
    ...

The second:

{
    "Dir": "/home/lx/mount/sda2/opensource/it-infrastructure/kubernetes/vendor/cloud.google.com/go/compute/metadata",
    "ImportPath": "cloud.google.com/go/compute/metadata",
    "Name": "metadata",
    "Doc": "Package metadata provides access to Google Compute Engine (GCE) metadata and API service accounts.",
    "Module": {
        "Path": "cloud.google.com/go/bigquery",
        "Replace": {
            "Path": "cloud.google.com/go/bigquery",
            "Version": "v1.4.0"
        },
        "Indirect": true
    },
    ...

Brian Candler

unread,
Apr 19, 2021, 12:05:38 PM4/19/21
to golang-nuts
Can you explain exactly which values you think are wrong, and what values they should have? I can't see any problem with those.

Examples I checked:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^            module (there is a go.mod here)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^      package within that module - no go.mod

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^       module (there is a go.mod here)

tapi...@gmail.com

unread,
Apr 19, 2021, 8:30:53 PM4/19/21
to golang-nuts
Reply all
Reply to author
Forward
0 new messages