Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snyk-go-plugin

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snyk-go-plugin - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

39

lib/index.js

@@ -33,3 +33,4 @@ var fs = require('fs');

var pkgsTree = recursivelyBuildPkgTree(tree, depLocks, []);
var projectRootPath = path.dirname(path.resolve(targetFile));
var pkgsTree = recursivelyBuildPkgTree(tree, depLocks, projectRootPath, []);
pkgsTree.packageFormatVersion = 'golang:0.0.1';

@@ -55,3 +56,27 @@

function recursivelyBuildPkgTree(goDepsTree, depLocks, fromPath) {
function isInternalPkg(pkgPath, projectRootPath) {
if (pkgPath == projectRootPath) {
return true;
}
var root = projectRootPath;
root =
(root[root.length - 1] == path.sep) ? root : (root + path.sep);
if (pkgPath.indexOf(root) != 0) {
return false;
}
var pkgRelativePath = pkgPath.slice(root.length);
if (
pkgRelativePath.indexOf('vendor/') == 0 ||
pkgRelativePath.indexOf('/vendor/') >= 0) {
return false;
}
return true;
}
function recursivelyBuildPkgTree(goDepsTree, depLocks, projectRootPath, fromPath) {
var isRoot = (fromPath.length == 0);

@@ -64,6 +89,9 @@

if (isRoot) {
if (isRoot || isInternalPkg(goDepsTree.Dir, projectRootPath)) {
pkg.version = '0.0.0';
} else if (!depLocks[pkg.name]) {
pkg.version = '';
// TODO: throw or warn here
} else {
pkg.version = depLocks[pkg.name] ? depLocks[pkg.name].version : '';
pkg.version = depLocks[pkg.name].version;
}

@@ -74,3 +102,4 @@

goDepsTree.Deps && goDepsTree.Deps.forEach(function (dep) {
var child = recursivelyBuildPkgTree(dep, depLocks, pkg.from)
var child = recursivelyBuildPkgTree(
dep, depLocks, projectRootPath, pkg.from)
pkg.dependencies[child.name] = child;

@@ -77,0 +106,0 @@ })

2

package.json

@@ -28,3 +28,3 @@ {

},
"version": "1.1.3"
"version": "1.1.4"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc