tools / godep

dependency tool for go
http://godoc.org/github.com/tools/godep
BSD 3-Clause "New" or "Revised" License
5.54k stars 455 forks source link

[RFC] godep list #484

Closed freeformz closed 6 years ago

freeformz commented 8 years ago

godep list should output what it thinks the state of packages are. This is mostly where is finds packages, so break it down by where a package is found. Packages that are main packages are surrounded by "()".

Proposed output for a list command:

$ godep list -goroot
/Users/emuller/go/src/github.com/heroku/log-shuttle
    Local
        github.com/heroku/log-shuttle
        (github.com/heroku/log-shuttle/cmd/main/log-shuttle)
    Godeps/_workspace/src
        X
        Y
        Z
    vendor/
        github.com/heroku/rollrus
        (github.com/mattes/migrate)
    $GOPATH
        /home/foo/go/src
            github.com/heroku/slog
        /home/foo/go2/src
            D
    $GOROOT
        /usr/local/go/src
            net
            foo
            bar
    MISSING
        github.com/foozle/bazzle
$ godep list -json -goroot
{
    "Location": "/Users/emuller/go/src/github.com/heroku/log-shuttle",
    "Local" : [
        "github.com/heroku/log-shuttle",
        "(github.com/heroku/log-shuttle/cmd/main/log-shuttle)"
    ],
    "Godeps/_workspace/src":[
        "X", "Y", "Z"
        ],
    "vendor": [
        "github.com/heroku/rollrus",
        "(github.com/mattes/migrate)"
    ],
    "$GOPATH": {
        "/home/foo/go/src": [
          "github.com/heroku/slog"
        ],
        "/home/foo/go2/src": [
            "D"
        ]
    },
    "$GOROOT": {
        "/usr/local/go/src": [
            "net",
            "foo",
            "bar"
        ]
    },
    "MISSING": [
        "github.com/foozle/bazzle"
    ]
}

Some things to consider, that currently aren't included: How should version information be relayed? In the txt output an @v1 or something could be appended/prepended to the line, but for JSON the structure would likely need to change.

owenthereal commented 8 years ago

:+1:

freeformz commented 6 years ago

Thanks, but I am closing this PR because the repo is going to be archived.