@@ -509,29 +509,19 @@ func (cmd *statusCommand) Run(ctx *dep.Ctx, args []string) error {
509
509
return err
510
510
}
511
511
512
- hasMissingPkgs , errCount , err := cmd .runStatusAll (ctx , out , p , sm )
513
- if err != nil {
514
- switch err {
512
+ _ , errCount , runerr := cmd .runStatusAll (ctx , out , p , sm )
513
+ if runerr != nil {
514
+ switch runerr {
515
515
case errFailedUpdate :
516
- // Print the results with unknown data
517
- ctx .Out .Println (buf .String ())
518
516
// Print the help when in non-verbose mode
519
517
if ! ctx .Verbose {
520
518
ctx .Out .Printf ("The status of %d projects are unknown due to errors. Rerun with `-v` flag to see details.\n " , errCount )
521
519
}
522
520
case errInputDigestMismatch :
523
- // Tell the user why mismatch happened and how to resolve it.
524
- if hasMissingPkgs {
525
- ctx .Err .Printf ("Lock inputs-digest mismatch due to the following packages missing from the lock:\n \n " )
526
- ctx .Out .Print (buf .String ())
527
- ctx .Err .Printf ("\n This happens when a new import is added. Run `dep ensure` to install the missing packages.\n " )
528
- } else {
529
- ctx .Err .Printf ("Lock inputs-digest mismatch. This happens when Gopkg.toml is modified.\n " +
530
- "Run `dep ensure` to regenerate the inputs-digest." )
531
- }
521
+ ctx .Err .Printf ("Gopkg.lock is out of sync with imports and/or Gopkg.toml. Run `dep check` for details.\n " )
522
+ default :
523
+ return runerr
532
524
}
533
-
534
- return err
535
525
}
536
526
537
527
if cmd .outFilePath == "" {
@@ -549,7 +539,7 @@ func (cmd *statusCommand) Run(ctx *dep.Ctx, args []string) error {
549
539
}
550
540
}
551
541
552
- return nil
542
+ return runerr
553
543
}
554
544
555
545
func (cmd * statusCommand ) validateFlags () error {
@@ -955,19 +945,13 @@ func (cmd *statusCommand) runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Proje
955
945
errListPkgCh := make (chan error , len (slp ))
956
946
errListVerCh := make (chan error , len (slp ))
957
947
958
- // Hardcode to a limit of 16 simultaneous projects. This is plenty high
959
- // enough to gain concurrency benefits, but low enough that we won't
960
- // hit an open fd limit on any OS.
961
- sem := make (chan struct {}, 16 )
962
948
var wg sync.WaitGroup
963
949
964
950
for i , proj := range slp {
965
951
wg .Add (1 )
966
952
logger .Printf ("(%d/%d) %s\n " , i + 1 , len (slp ), proj .Ident ().ProjectRoot )
967
- sem <- struct {}{}
968
953
969
954
go func (proj verify.VerifiableProject ) {
970
- defer func () { <- sem }()
971
955
bs := BasicStatus {
972
956
ProjectRoot : string (proj .Ident ().ProjectRoot ),
973
957
PackageCount : len (proj .Packages ()),
@@ -1333,20 +1317,14 @@ func collectConstraints(ctx *dep.Ctx, p *dep.Project, sm gps.SourceManager) (con
1333
1317
// Channel for receiving all the errors.
1334
1318
errCh := make (chan error , len (lp ))
1335
1319
1336
- // Hardcode to a limit of 16 simultaneous projects. This is plenty high
1337
- // enough to gain concurrency benefits, but low enough that we won't
1338
- // hit an open fd limit on any OS.
1339
- sem := make (chan struct {}, 16 )
1340
1320
var wg sync.WaitGroup
1341
1321
1342
1322
// Iterate through the locked projects and collect constraints of all the projects.
1343
1323
for i , proj := range lp {
1344
1324
wg .Add (1 )
1345
1325
logger .Printf ("(%d/%d) %s\n " , i + 1 , len (lp ), proj .Ident ().ProjectRoot )
1346
- sem <- struct {}{}
1347
1326
1348
1327
go func (proj gps.LockedProject ) {
1349
- defer func () { <- sem }()
1350
1328
defer wg .Done ()
1351
1329
1352
1330
manifest , _ , err := sm .GetManifestAndLock (proj .Ident (), proj .Version (), rootAnalyzer )
0 commit comments