Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #12 from golang/status
Browse files Browse the repository at this point in the history
dep: attempt to make 'status' work without any state
  • Loading branch information
sdboyer authored Nov 18, 2016
2 parents 4eb9342 + e021cdc commit 43cb4a9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions status.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,15 @@ func runStatusAll(p *project, sm *gps.SourceMgr) error {
// repository cache.
for _, proj := range p.l.Projects() {
id := proj.Ident()
go func() {
sm.ListVersions(id)
}()
go sm.ListVersions(id)
}

// While the network churns on ListVersions() requests, statically analyze
// code from the current project.
ptree, err := gps.ListPackages(p.absroot, string(p.importroot))
if err != nil {
return fmt.Errorf("analysis of local packages failed: %v", err)
}

// Set up a solver in order to check the InputHash.
params := gps.SolveParameters{
Expand All @@ -125,7 +126,7 @@ func runStatusAll(p *project, sm *gps.SourceMgr) error {

s, err := gps.Prepare(params, sm)
if err != nil {
return fmt.Errorf("could not set up solver for input hashing, err: %s", err)
return fmt.Errorf("could not set up solver for input hashing: %s", err)
}

cm := collectConstraints(ptree, p, sm)
Expand Down Expand Up @@ -206,7 +207,19 @@ func runStatusAll(p *project, sm *gps.SourceMgr) error {
// constraints.
//
// TODO

external := ptree.ExternalReach(true, false, nil).ListExternalImports()

// List imports?
for _, importPath := range external {
fmt.Fprintf(tw,
"%s\t\t\t\t\t\t\n",
importPath,
)

}
}
tw.Flush()

return nil
}
Expand Down

0 comments on commit 43cb4a9

Please sign in to comment.