mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: update compose-go to v2.0.2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
8
vendor/github.com/compose-spec/compose-go/v2/template/template.go
generated
vendored
8
vendor/github.com/compose-spec/compose-go/v2/template/template.go
generated
vendored
@ -44,7 +44,7 @@ var patternString = fmt.Sprintf(
|
||||
groupInvalid,
|
||||
)
|
||||
|
||||
var defaultPattern = regexp.MustCompile(patternString)
|
||||
var DefaultPattern = regexp.MustCompile(patternString)
|
||||
|
||||
// InvalidTemplateError is returned when a variable template is not in a valid
|
||||
// format
|
||||
@ -121,7 +121,7 @@ func SubstituteWithOptions(template string, mapping Mapping, options ...Option)
|
||||
var returnErr error
|
||||
|
||||
cfg := &Config{
|
||||
pattern: defaultPattern,
|
||||
pattern: DefaultPattern,
|
||||
replacementFunc: DefaultReplacementFunc,
|
||||
logging: true,
|
||||
}
|
||||
@ -268,14 +268,14 @@ func getFirstBraceClosingIndex(s string) int {
|
||||
|
||||
// Substitute variables in the string with their values
|
||||
func Substitute(template string, mapping Mapping) (string, error) {
|
||||
return SubstituteWith(template, mapping, defaultPattern)
|
||||
return SubstituteWith(template, mapping, DefaultPattern)
|
||||
}
|
||||
|
||||
// ExtractVariables returns a map of all the variables defined in the specified
|
||||
// composefile (dict representation) and their default value if any.
|
||||
func ExtractVariables(configDict map[string]interface{}, pattern *regexp.Regexp) map[string]Variable {
|
||||
if pattern == nil {
|
||||
pattern = defaultPattern
|
||||
pattern = DefaultPattern
|
||||
}
|
||||
return recurseExtract(configDict, pattern)
|
||||
}
|
||||
|
Reference in New Issue
Block a user