1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/ext/file/ext.go

20 lines
307 B
Go
Raw Normal View History

package file
import (
"path/filepath"
)
func IsYaml(path string) bool {
ext := filepath.Ext(path)
return ext == ".yml" || ext == ".yaml"
}
func IsJson(path string) bool {
ext := filepath.Ext(path)
return ext == ".json"
}
func IsYamlOrJson(path string) bool {
return IsYaml(path) || IsJson(path)
}