-
Notifications
You must be signed in to change notification settings - Fork 396
Open
Description
Summary
Currently, config value normalization (e.g., strings.ToLower for SHA256 hashes) happens at each call site when retrieving values. This leads to repetitive normalization calls scattered throughout the codebase.
Current Pattern
// In getExpectedSHA256
if hash := cfg.Get("BAZELISK_VERIFY_SHA256_" + suffix); hash != "" {
return strings.ToLower(hash)
}Similar patterns exist in other places like getBazeliskHome with strings.ToUpper.
Proposed Improvement
Normalize values once at the config layer (when storing/loading), so all consumers can assume values are already in the expected format.
This would:
- Reduce code duplication
- Prevent bugs from forgotten normalization
- Make the codebase cleaner
Related
This was identified while working on #766 (platform-specific SHA256 verification).
Metadata
Metadata
Assignees
Labels
No labels