aquasecurity / aquasecurity/bench-common
Tidy up config reading
- Dominant language
- Go
- Stars
- 10
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
If I'm reading this correctly, this code [reads in a config file to viper](https://github.com/aquasecurity/bench-common/blob/93006063b47cf56ad8b9f1cfa4c03a861c6b330f/root.go#L88) but then apparently also reads in and parses the same file again in [`getControls()`](https://github.com/aquasecurity/bench-common/blob/93006063b47cf56ad8b9f1cfa4c03a861c6b330f/app.go#L65) which is wasteful and confusing
Contributor guide
Research direction
Start by comparing the config loading in root.go around line 88 with getControls() in app.go around line 65, following the linked revision and how viper is used. Confirm whether the same file is read and parsed twice, then define the cleanup so configuration is loaded once without changing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100