优化结构

This commit is contained in:
Yvan
2026-08-28 16:37:53 +08:00
parent 295ee5c49e
commit 6f9908d926
14 changed files with 56 additions and 58 deletions
+5 -1
View File
@@ -1,5 +1,7 @@
package config
import "strings"
// MaskedSecret is the placeholder written in place of a stored secret whenever a
// configuration payload leaves the process. Every layer that masks or preserves
// configuration secrets shares this sentinel so a masked read round-trips into a
@@ -8,7 +10,9 @@ const MaskedSecret = "******"
// IsMaskedSecret reports whether an inbound value carries no new secret, either
// because it was omitted or because it is the mask handed out on read.
func IsMaskedSecret(value string) bool { return value == "" || value == MaskedSecret }
func IsMaskedSecret(value string) bool {
return strings.TrimSpace(value) == "" || strings.TrimSpace(value) == MaskedSecret
}
// ObjectStores lists every object-store block of a storage configuration so
// callers iterate the providers instead of repeating the list.