MCPcopy Create free account
hub / github.com/docker/secrets-engine / MustParsePattern

Function MustParsePattern

x/secrets/pattern.go:133–138  ·  view source on GitHub ↗

MustParsePattern parses a string into a [Pattern] like with [ParsePattern], however, it panics when a validation error occurs.

(s string)

Source from the content-addressed store, hash-verified

131// MustParsePattern parses a string into a [Pattern] like with [ParsePattern],
132// however, it panics when a validation error occurs.
133func MustParsePattern(s string) Pattern {
134 if !validPattern(s) {
135 panic(ErrInvalidPattern)
136 }
137 return pattern(s)
138}
139
140func (p pattern) ExpandID(other ID) (ID, error) {
141 val, err := replace1(string(p), other.String())

Callers 2

TestPatternComparableFunction · 0.85
Test_FilterFunction · 0.85

Calls 2

validPatternFunction · 0.85
patternTypeAlias · 0.85

Tested by 2

TestPatternComparableFunction · 0.68
Test_FilterFunction · 0.68