adding literal colon to interpolated regex
This commit is contained in:
parent
fd6382fbaf
commit
e970eea3cd
|
@ -16,7 +16,7 @@ const InterpSplitDelim = `B780FFEC-B661-4EB8-9236-A01737AD98B6`
|
|||
|
||||
// interpRegexp is a regexp that matches interpolations such as ${foo.bar}
|
||||
var interpRegexp *regexp.Regexp = regexp.MustCompile(
|
||||
`(?i)(\$+)\{([\s*-.,\\/\(\)a-z0-9_"]+)\}`)
|
||||
`(?i)(\$+)\{([\s*-.,\\/\(\):a-z0-9_"]+)\}`)
|
||||
|
||||
// interpolationWalker implements interfaces for the reflectwalk package
|
||||
// (github.com/mitchellh/reflectwalk) that can be used to automatically
|
||||
|
|
|
@ -129,6 +129,25 @@ func TestInterpolationWalker_detect(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
Input: map[string]interface{}{
|
||||
"foo": `${concat("localhost", ":8080")}`,
|
||||
},
|
||||
Result: []Interpolation{
|
||||
&FunctionInterpolation{
|
||||
Func: nil,
|
||||
Args: []Interpolation{
|
||||
&LiteralInterpolation{
|
||||
Literal: "localhost",
|
||||
},
|
||||
&LiteralInterpolation{
|
||||
Literal: ":8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for i, tc := range cases {
|
||||
|
|
Loading…
Reference in New Issue