@@ -44,8 +44,8 @@ Status returns exit code zero if all dependencies are in a "good state".
44
44
`
45
45
46
46
const (
47
- shortRev = iota
48
- longRev = iota
47
+ shortRev uint8 = iota
48
+ longRev
49
49
)
50
50
51
51
var (
@@ -317,7 +317,7 @@ func (bs *BasicStatus) getConsolidatedVersion() string {
317
317
return version
318
318
}
319
319
320
- func (bs * BasicStatus ) getConsolidatedLatest (revSize int ) string {
320
+ func (bs * BasicStatus ) getConsolidatedLatest (revSize uint8 ) string {
321
321
latest := ""
322
322
if bs .Latest != nil {
323
323
switch revSize {
@@ -408,10 +408,10 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
408
408
409
409
logger .Println ("Checking upstream projects:" )
410
410
411
- // BasicStatus channel to collect all the BasicStatus
411
+ // BasicStatus channel to collect all the BasicStatus.
412
412
bsCh := make (chan * BasicStatus , len (slp ))
413
413
414
- // Error channels to collect different errors
414
+ // Error channels to collect different errors.
415
415
errListPkgCh := make (chan error , len (slp ))
416
416
errListVerCh := make (chan error , len (slp ))
417
417
@@ -422,15 +422,13 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
422
422
logger .Printf ("(%d/%d) %s\n " , i + 1 , len (slp ), proj .Ident ().ProjectRoot )
423
423
424
424
go func (proj gps.LockedProject ) {
425
- defer wg .Done ()
426
-
427
425
bs := BasicStatus {
428
426
ProjectRoot : string (proj .Ident ().ProjectRoot ),
429
427
PackageCount : len (proj .Packages ()),
430
428
}
431
429
432
430
// Get children only for specific outputers
433
- // in order to avoid slower status process
431
+ // in order to avoid slower status process.
434
432
switch out .(type ) {
435
433
case * dotOutput :
436
434
ptr , err := sm .ListPackages (proj .Ident (), proj .Version ())
@@ -444,7 +442,7 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
444
442
bs .Children = prm .FlattenFn (paths .IsStandardImportPath )
445
443
}
446
444
447
- // Split apart the version from the lock into its constituent parts
445
+ // Split apart the version from the lock into its constituent parts.
448
446
switch tv := proj .Version ().(type ) {
449
447
case gps.UnpairedVersion :
450
448
bs .Version = tv
@@ -494,14 +492,15 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
494
492
}
495
493
} else {
496
494
// Failed to fetch version list (could happen due to
497
- // network issue)
495
+ // network issue).
498
496
bs .hasError = true
499
497
errListVerCh <- err
500
498
}
501
499
}
502
500
503
501
bsCh <- & bs
504
502
503
+ wg .Done ()
505
504
}(proj )
506
505
}
507
506
@@ -510,7 +509,7 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
510
509
close (errListPkgCh )
511
510
close (errListVerCh )
512
511
513
- // Newline after printing the status progress output
512
+ // Newline after printing the status progress output.
514
513
logger .Println ()
515
514
516
515
// List Packages errors. This would happen only for dot output.
@@ -524,7 +523,7 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
524
523
}
525
524
}
526
525
527
- // List Version errors
526
+ // List Version errors.
528
527
if len (errListVerCh ) > 0 {
529
528
if err == nil {
530
529
err = errFailedUpdate
@@ -551,7 +550,7 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
551
550
bsMap [bs .ProjectRoot ] = bs
552
551
}
553
552
554
- // Use the collected BasicStatus in outputter
553
+ // Use the collected BasicStatus in outputter.
555
554
for _ , proj := range slp {
556
555
out .BasicLine (bsMap [string (proj .Ident ().ProjectRoot )])
557
556
}
0 commit comments