优化结构
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user