checking in before refactoring interpolation

This commit is contained in:
brent saner
2024-04-11 12:46:13 -04:00
parent 187ad868db
commit eed9c34ebf
17 changed files with 2014 additions and 48 deletions

View File

@@ -9,3 +9,25 @@ var (
reMaybeInt *regexp.Regexp = regexp.MustCompile(`^(?P<sign>\+|-)[0-9]+$`)
reMaybeFloat *regexp.Regexp = regexp.MustCompile(`(?P<sign>\+|-)?[0-9]+\.[0-9]+$`)
)
var (
StructTagInterpolate string = "envsub"
StructTagPopulate string = "envpop"
)
var (
defaultInterpolateOpts interpolateOpts = interpolateOpts{
noMapKey: false,
noMapVal: false,
}
// InterpolateOptNoMapKey is the equivalent of the struct tag `no_map_key` for Interpolate.
InterpolateOptNoMapKey optInterpolate = func(o *interpolateOpts) (err error) {
o.noMapKey = true
return
}
// InterpolateOptNoMapValue is the equivalent of the struct tag `no_map_value` for Interpolate.
InterpolateOptNoMapValue optInterpolate = func(o *interpolateOpts) (err error) {
o.noMapVal = true
return
}
)