@@ -50,7 +50,7 @@ public GoComponentDetector(
50
50
51
51
public override IEnumerable < ComponentType > SupportedComponentTypes { get ; } = new [ ] { ComponentType . Go } ;
52
52
53
- public override int Version => 8 ;
53
+ public override int Version => 7 ;
54
54
55
55
protected override Task < IObservable < ProcessRequest > > OnPrepareDetectionAsync (
56
56
IObservable < ProcessRequest > processRequests , IDictionary < string , string > detectorArgs )
@@ -282,7 +282,6 @@ private async Task ParseGoModFileAsync(
282
282
GoGraphTelemetryRecord goGraphTelemetryRecord )
283
283
{
284
284
using var reader = new StreamReader ( file . Stream ) ;
285
- var startString = "require " ;
286
285
287
286
// There can be multiple require( ) sections in go 1.17+. loop over all of them.
288
287
while ( ! reader . EndOfStream )
@@ -298,9 +297,9 @@ private async Task ParseGoModFileAsync(
298
297
299
298
// In go >= 1.17, direct dependencies are listed as "require x/y v1.2.3", and transitive dependencies
300
299
// are listed in the require () section
301
- if ( line . StartsWith ( startString ) )
300
+ if ( line . StartsWith ( "require " ) )
302
301
{
303
- this . TryRegisterDependencyFromModLine ( line [ startString . Length ..] , singleFileComponentRecorder ) ;
302
+ this . TryRegisterDependencyFromModLine ( line [ 8 ..] , singleFileComponentRecorder ) ;
304
303
}
305
304
306
305
line = await reader . ReadLineAsync ( ) ;
@@ -444,15 +443,7 @@ private void RecordBuildDependencies(string goListOutput, ISingleFileComponentRe
444
443
continue ;
445
444
}
446
445
447
- GoComponent goComponent ;
448
- if ( dependency . Replace != null )
449
- {
450
- goComponent = new GoComponent ( dependency . Replace . Path , dependency . Replace . Version ) ;
451
- }
452
- else
453
- {
454
- goComponent = new GoComponent ( dependency . Path , dependency . Version ) ;
455
- }
446
+ var goComponent = new GoComponent ( dependency . Path , dependency . Version ) ;
456
447
457
448
if ( dependency . Indirect )
458
449
{
@@ -492,7 +483,5 @@ private class GoBuildModule
492
483
public string Version { get ; set ; }
493
484
494
485
public bool Indirect { get ; set ; }
495
-
496
- public GoBuildModule Replace { get ; set ; }
497
486
}
498
487
}
0 commit comments