MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / FindUnknownPlaceholders

Function FindUnknownPlaceholders

pkg/postgres/environment.go:96–105  ·  view source on GitHub ↗

FindUnknownPlaceholders returns the list of unrecognized ${...} placeholders found in the given value. Escaped placeholders ($${...}) are ignored.

(value string)

Source from the content-addressed store, hash-verified

94// FindUnknownPlaceholders returns the list of unrecognized ${...} placeholders
95// found in the given value. Escaped placeholders ($${...}) are ignored.
96func FindUnknownPlaceholders(value string) []string {
97 var unknown []string
98 for _, match := range envPlaceholderRegexp.FindAllStringSubmatch(value, -1) {
99 // Only odd dollar counts are real placeholders.
100 if len(match[1])%2 == 1 && !knownPlaceholders[match[2]] {
101 unknown = append(unknown, "${"+match[2]+"}")
102 }
103 }
104 return unknown
105}

Callers 3

SetEnvVarsFunction · 0.92
validateExtensionEnvVarsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected