Skip to content

Commit 9b2ceec

Browse files
In Go detector, Added error log to expose go cli error. (#118)
1 parent 0bab2ee commit 9b2ceec

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Microsoft.ComponentDetection.Detectors/go/GoComponentDetector.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ private async Task<bool> UseGoCliToScan(string location, ISingleFileComponentRec
124124
var goDependenciesProcess = await CommandLineInvocationService.ExecuteCommand("go", null, workingDirectory: projectRootDirectory, new[] { "list", "-m", "-json", "all" });
125125
if (goDependenciesProcess.ExitCode != 0)
126126
{
127+
Logger.LogError($"Go CLI command \"go list -m -json all\" failed with error:\n {goDependenciesProcess.StdErr}");
127128
Logger.LogError($"Go CLI could not get dependency build list at location: {location}. Fallback go.sum/go.mod parsing will be used.");
128129
return false;
129130
}

0 commit comments

Comments
 (0)