You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve error handling for environment variable parsing
This commit addresses code review feedback to improve robustness:
1. Add proper error handling for strconv.ParseBool in validateKVEventConfiguration()
- Return descriptive errors instead of silently ignoring parse failures
- Help users identify configuration issues early
2. Add warning logs in validateConfiguration() for invalid boolean values
- Log warnings when environment variables contain invalid boolean values
- Default to false but inform users about the parsing issue
3. Replace goto with labeled break for better Go idioms
- Use labeled break instead of goto for loop exit
- Improves code readability and follows Go best practices
These changes make configuration errors more visible and easier to debug,
preventing silent failures when users set invalid environment variable values.
Signed-off-by: ZHENYU <[email protected]>
0 commit comments