Elide Redis password when printing configs.

This commit is contained in:
gram-signal 2026-04-08 14:37:31 -07:00 committed by GitHub
parent 0c642b0304
commit 399181561d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,3 +35,12 @@ func (r *RedisConfig) validate() []string {
}
return errs
}
// String overrides the normal string mechanism to hide Password.
func (r *RedisConfig) String() string {
return fmt.Sprintf("RedisConfig{Addrs: %v, Password: <elided>, Name: %q, MinSleepDuration: %v, MaxSleepDuration: %v}", r.Addrs, r.Name, r.MinSleepDuration, r.MaxSleepDuration)
}
func (r *RedisConfig) GoString() string {
return r.String()
}