INNER CODE UNIT · Go
tomlKeyQuote
betterleaks/betterleaks · cmd/generate/config/main.go:24
func tomlKeyQuote(key string) string {
if strings.ContainsAny(key, ". \t") {
return fmt.Sprintf("%q", key)
}
return key
}
// tomlQuote returns a TOML-safe quoted string. Values containing liquid
// template syntax ({{ ... }}) use TOML literal strings (single quotes) to
// avoid escaping inner double quotes used by filters like append/b64enc.
func tomlQuote(s string) string {
if strings.Contains(s, "{{") {
return "'" + s + "'"
}
return fmt.Sprintf("%q", s)
}
func tomlValue(v any) string {