snyk-go-plugin
Advanced tools
Comparing version 1.10.1 to 1.10.2
@@ -91,3 +91,3 @@ "use strict"; | ||
let tempDirObj; | ||
const packageManager = PACKAGE_MANAGER_BY_TARGET[targetFile]; | ||
const packageManager = pkgManagerByTarget(targetFile); | ||
if (packageManager === 'gomodules') { | ||
@@ -293,4 +293,4 @@ return buildDepTreeFromImportsAndModules(root); | ||
const depTree = { | ||
name: '.', | ||
version: 'unknown', | ||
name: path.basename(root), | ||
version: '0.0.0', | ||
packageFormatVersion: 'golang:0.0.1', | ||
@@ -309,4 +309,6 @@ }; | ||
const localPackages = goDeps.filter((gp) => !gp.DepOnly); | ||
if (localPackages[0].Module) { | ||
depTree.name = localPackages[0].Module.Path; | ||
const localPackageWithMainModule = localPackages | ||
.find((localPackage) => (localPackage.Module && localPackage.Module.Main)); | ||
if (localPackageWithMainModule && localPackageWithMainModule.Module.Path) { | ||
depTree.name = localPackageWithMainModule.Module.Path; | ||
} | ||
@@ -313,0 +315,0 @@ const topLevelDeps = extractAllImports(localPackages); |
@@ -128,3 +128,3 @@ import * as fs from 'fs'; | ||
let tempDirObj; | ||
const packageManager = PACKAGE_MANAGER_BY_TARGET[targetFile]; | ||
const packageManager = pkgManagerByTarget(targetFile); | ||
if (packageManager === 'gomodules') { | ||
@@ -459,4 +459,4 @@ return buildDepTreeFromImportsAndModules(root); | ||
const depTree: DepTree = { | ||
name: '.', // The correct name should come from the go.mod parser | ||
version: 'unknown', // TODO(BST-657): try `git describe`? | ||
name: path.basename(root), // The correct name should come from the `go list` command | ||
version: '0.0.0', // TODO(BST-657): try `git describe`? | ||
packageFormatVersion: 'golang:0.0.1', | ||
@@ -476,4 +476,6 @@ }; | ||
const localPackages = goDeps.filter((gp) => !gp.DepOnly); | ||
if (localPackages[0].Module) { | ||
depTree.name = localPackages[0].Module.Path; | ||
const localPackageWithMainModule = localPackages | ||
.find((localPackage) => (localPackage.Module && localPackage.Module.Main)); | ||
if (localPackageWithMainModule && localPackageWithMainModule!.Module!.Path) { | ||
depTree.name = localPackageWithMainModule!.Module!.Path; | ||
} | ||
@@ -480,0 +482,0 @@ |
@@ -42,3 +42,3 @@ { | ||
}, | ||
"version": "1.10.1" | ||
"version": "1.10.2" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73736
963