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