config: accept file("test.txt") [GH-145]
This commit is contained in:
parent
40bd1580e4
commit
742e33c672
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
// interpRegexp is a regexp that matches interpolations such as ${foo.bar}
|
// interpRegexp is a regexp that matches interpolations such as ${foo.bar}
|
||||||
var interpRegexp *regexp.Regexp = regexp.MustCompile(
|
var interpRegexp *regexp.Regexp = regexp.MustCompile(
|
||||||
`(?i)(\$+)\{([\s*-.,\(\)a-z0-9_]+)\}`)
|
`(?i)(\$+)\{([\s*-.,\(\)a-z0-9_"]+)\}`)
|
||||||
|
|
||||||
// interpolationWalker implements interfaces for the reflectwalk package
|
// interpolationWalker implements interfaces for the reflectwalk package
|
||||||
// (github.com/mitchellh/reflectwalk) that can be used to automatically
|
// (github.com/mitchellh/reflectwalk) that can be used to automatically
|
||||||
|
|
|
@ -71,6 +71,22 @@ func TestInterpolationWalker_detect(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
Input: map[string]interface{}{
|
||||||
|
"foo": `${file("test.txt")}`,
|
||||||
|
},
|
||||||
|
Result: []Interpolation{
|
||||||
|
&FunctionInterpolation{
|
||||||
|
Func: nil,
|
||||||
|
Args: []Interpolation{
|
||||||
|
&LiteralInterpolation{
|
||||||
|
Literal: "test.txt",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, tc := range cases {
|
for i, tc := range cases {
|
||||||
|
|
Loading…
Reference in New Issue