Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go Modules support #34

Closed
ghost opened this issue Jan 7, 2019 · 6 comments
Closed

Go Modules support #34

ghost opened this issue Jan 7, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Jan 7, 2019

Are there any plans to support vgo?

@moorara
Copy link

moorara commented Feb 4, 2019

Or, we can say now please provide support for Go modules.

@kyegupov kyegupov changed the title vgo support Go Modules support May 31, 2019
@a-h
Copy link

a-h commented Jun 11, 2019

I just tried this out locally by updating the snyk tool to use the latest version of the plugin and making a few tweaks to it.

diff --git a/package.json b/package.json
index 0eedc25d..daa1b2dd 100644
--- a/package.json
+++ b/package.json
@@ -71,7 +71,7 @@
     "semver": "^6.0.0",
     "snyk-config": "^2.2.1",
     "snyk-docker-plugin": "1.25.1",
-    "snyk-go-plugin": "1.9.0",
+    "snyk-go-plugin": "1.10.0",
     "snyk-gradle-plugin": "2.12.4",
     "snyk-module": "1.9.1",
     "snyk-mvn-plugin": "2.3.0",
diff --git a/src/lib/detect.ts b/src/lib/detect.ts
index 60e36f7d..d6c4c534 100644
--- a/src/lib/detect.ts
+++ b/src/lib/detect.ts
@@ -21,6 +21,7 @@ const DETECTABLE_FILES: string[] = [
   'requirements.txt',
   'Gopkg.lock',
   'vendor/vendor.json',
+  'go.mod',
   'obj/project.assets.json',
   'project.assets.json',
   'packages.config',
@@ -46,6 +47,7 @@ const DETECTABLE_PACKAGE_MANAGERS: {
   'requirements.txt': 'pip',
   'Gopkg.lock': 'golangdep',
   'vendor.json': 'govendor',
+  'go.mod': 'gomod',
   'project.assets.json': 'nuget',
   'packages.config': 'nuget',
   'project.json': 'nuget',
diff --git a/src/lib/package-managers.ts b/src/lib/package-managers.ts
index 38363768..98a696c9 100644
--- a/src/lib/package-managers.ts
+++ b/src/lib/package-managers.ts
@@ -1,5 +1,5 @@
 export type SupportedPackageManagers = 'rubygems' | 'npm' | 'yarn' |
-'maven' | 'pip' | 'sbt' | 'gradle' | 'golangdep' | 'govendor' |
+'maven' | 'pip' | 'sbt' | 'gradle' | 'golangdep' | 'govendor' | 'gomod' |
 'nuget' | 'paket' | 'composer';
 
 export const SUPPORTED_PACKAGE_MANAGER_NAME: {
@@ -14,6 +14,7 @@ export const SUPPORTED_PACKAGE_MANAGER_NAME: {
   gradle: 'Gradle',
   golangdep: 'dep (Go)',
   govendor: 'govendor',
+  gomod: 'go mod',
   nuget: 'NuGet',
   paket: 'Paket',
   composer: 'Composer',
diff --git a/src/lib/plugins/index.ts b/src/lib/plugins/index.ts
index ddbc7876..0d46af36 100644
--- a/src/lib/plugins/index.ts
+++ b/src/lib/plugins/index.ts
@@ -40,7 +40,8 @@ export function loadPlugin(packageManager: SupportedPackageManagers,
       return pythonPlugin;
     }
     case 'golangdep':
-    case 'govendor': {
+    case 'govendor': 
+    case 'gomod': {
       return goPlugin;
     }
     case 'nuget': {

After running this, you can run the updated local version by running yarn build to build it, npm install -g pkg to install the packaging tool, pkg . to build the software, then you'll get a binary you can run.

I ran snyk test and it worked as expected for me. snyk monitor failed with a 404 error, so I guess the server-side needs to be released before that can work.

@lili2311
Copy link
Contributor

lili2311 commented Jun 27, 2019

Please updates here: https://github.com/snyk/snyk/issues/354

TLDR: Go Modules is now behind a feature flag, if you would like to test this out please email support@snyk.io with an org name you would like to try this on and we can enable :)

@erichusband
Copy link

Just a quick update for those interested, Go Modules are now generally available. No need to contact support, just upgrade to the latest version of the CLI and you're all set! :-)

@moorara
Copy link

moorara commented Jul 13, 2019

@erichusband @lili2311
Does your GitHub Marketplace app also support Go modules?

@lili2311
Copy link
Contributor

lili2311 commented Oct 2, 2019

@moorara Go modules is not yet available on Github / Gitlab etc, but this is now on our roadmap so stay tuned over the next few months :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants