Add support for Go 1.6 block keyword in templates

NOTE: Needs Go 1.6 to use the new feature.

Fixes #1832
This commit is contained in:
Bjørn Erik Pedersen
2016-02-09 18:39:17 +01:00
parent 924028a9be
commit a2abad9677
3 changed files with 192 additions and 28 deletions

View File

@@ -462,6 +462,11 @@ func FileContains(filename string, subslice []byte, fs afero.Fs) (bool, error) {
return afero.FileContainsBytes(fs, filename, subslice)
}
// Check if a file contains any of the specified strings.
func FileContainsAny(filename string, subslices [][]byte, fs afero.Fs) (bool, error) {
return afero.FileContainsAnyBytes(fs, filename, subslices)
}
// Check if a file or directory exists.
func Exists(path string, fs afero.Fs) (bool, error) {
return afero.Exists(fs, path)