Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Improve handling of GOPATH #108

Open
evqna opened this issue Jan 17, 2019 · 2 comments
Open

Improve handling of GOPATH #108

evqna opened this issue Jan 17, 2019 · 2 comments
Labels
enhancement New feature or request task-size-medium

Comments

@evqna
Copy link
Contributor

evqna commented Jan 17, 2019

Is your feature request related to a problem? Please describe.
Our current installation process requires users to manually update the gopath and point it to the cache folder if they want to use gosec. This is error prone and complicates deployment.

Describe the solution you'd like
Using the env parameter of child_process.spawn(), we can inject the gopath into spawned gosec processes. This removes the need for additional configuration and gives us more flexibility to handle save paths since every spawned gosec instance could have a different gopath specific to the current PR save location (currently all go source must be in /cache/go/src for this reason). This could allow us to use a more sensible directory layout in the cache and remove the need to have two code branches in all of the file save logic.

Additionally this removes the need to pollute the global namespace.

Describe alternatives you've considered
We could alternatively use the .env file to inject environmental variables in the program.

Additional context
More info: Node JS child process handling

@ericwb ericwb added the enhancement New feature or request label Jan 17, 2019
@joshuagl joshuagl added this to the Near Future milestone May 2, 2019
@MVrachev
Copy link
Contributor

MVrachev commented May 2, 2019

Gosec just released version 2.0 which adds support for Go modules.
That should give us the flexibility to work without GOPATH.

@MVrachev MVrachev modified the milestones: Near Future, Initial release May 2, 2019
@joshuagl
Copy link
Contributor

This is blocked by #227

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request task-size-medium
Projects
None yet
Development

No branches or pull requests

4 participants