Replace JSON/YAML marshaling with just YAML marshaling
- Dominant language
- Go
- Stars
- 21
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Original Author: @dkirillov
## Summary
The `readConfigFile` function is able to read both YAML and JSON file. Using a switch-statement it picks the correct class to unmarshal data with.
This switch statement can be removed in favor of using just YAML (from `gopkg.in/yaml.v3`) to unmarshal things.
## Motivation
Reduce and make cleaner code.
## Describe alternatives you've considered
N/A
## Additional context
An attempt was made, however, started to look like a rabbit hole with the errors that would come up (see screenshot below).
It should be possible, just would need to have a separate PR for clarity.
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the readConfigFile function and inspect how it currently switches between JSON and YAML unmarshaling, including the gopkg.in/yaml.v3 usage. Check the errors encountered by the earlier attempt before simplifying the logic; done means configuration files still unmarshal correctly without the switch and the related errors are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, yaml
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100