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

Merged

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
@pixelmaxQm pixelmaxQm changed the base branch from main to dev-281 April 18, 2025 03:09
@pixelmaxQm pixelmaxQm merged commit e2d7f6a into flipped-aurora:dev-281 Apr 18, 2025
8 checks passed
@huiyifyj huiyifyj deleted the separate-config-path-to-func branch April 18, 2025 03:38
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.

2 participants