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.4 to 1.2.0

43

lib/index.js

@@ -12,8 +12,19 @@ var fs = require('fs');

function inspect(root, targetFile, options) {
if (!options) { options = { dev: false }; }
return Promise.all([
getMetaData(root),
getDependencies(root, targetFile),
])
.then(function (result) {
return {
plugin: result[0],
package: result[1],
};
});
}
function getDependencies(root, targetFile) {
var depLocks;
return new Promise(function (resolve, reject) {
try {
depLocks = parseDepLock(root, targetFile, options);
depLocks = parseDepLock(root, targetFile);
resolve(depLocks);

@@ -38,9 +49,3 @@ } catch (e) {

return {
plugin: {
name: 'snyk-go-plugin',
// TODO: engine: `go version`
},
package: pkgsTree,
}
return pkgsTree;
}).catch(function (error) {

@@ -57,3 +62,13 @@ if (typeof error === 'string') {

function isInternalPkg(pkgPath, projectRootPath) {
function getMetaData(root) {
return subProcess.execute('go', ['version'], {cwd: root})
.then(function (output) {
return {
name: 'snyk-go-plugin',
runtime: /(go\d+\.\d+\.\d+)/.exec(output)[0],
};
});
}
function isRootSubpkg(pkgPath, projectRootPath) {
if (pkgPath == projectRootPath) {

@@ -90,7 +105,7 @@ return true;

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

@@ -111,3 +126,3 @@ pkg.version = depLocks[pkg.name].version;

function parseDepLock(root, targetFile, options) {
function parseDepLock(root, targetFile) {
var lock = fs.readFileSync(path.join(root, targetFile));

@@ -137,2 +152,2 @@

return deps;
}
}

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

},
"version": "1.1.4"
"version": "1.2.0"
}

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