1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/ext/file-info/ext.go
Charles-Edouard Brétéché 703f7a7666
feat: add utils packages in ext (#8766)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-10-28 14:53:19 +00:00

28 lines
420 B
Go

package fileinfo
import (
"io/fs"
"github.com/kyverno/kyverno/ext/file"
)
func IsYaml(info fs.FileInfo) bool {
if info.IsDir() {
return false
}
return file.IsYaml(info.Name())
}
func IsJson(info fs.FileInfo) bool {
if info.IsDir() {
return false
}
return file.IsJson(info.Name())
}
func IsYamlOrJson(info fs.FileInfo) bool {
if info.IsDir() {
return false
}
return file.IsYamlOrJson(info.Name())
}