Skip to content

refactor: separate config path acquisition to getConfigPath() function #2004

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

huiyifyj
Copy link
Contributor

@huiyifyj huiyifyj commented Apr 8, 2025

  • Extract config path logic to separate getConfigPath() function.
  • Simplify config priority handling: cmd flag > env variable > default by mode.
  • Remove unnecessary param path for viper() function.
  • Add fallback to default config path when mode-specific config file doesn't exist.

huiyifyj added 2 commits April 8, 2025 09:46
- Extract config path logic to separate `getConfigPath()` function.
- Simplify config priority handling: cmd flag > env variable > default by mode.
- Remove unnecessary param `path` for `viper()` function.
- Use specific config files for debug mode.
- Add fallback to default config path when mode-specific config file doesn't exist.
- Enhance error messages with better formatting and wrapping:
  * Error strings should not end with punctuation or newlines.
  * Error strings should not be capitalized, refer to https://go.dev/wiki/CodeReviewComments#error-strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant