1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/ext/file/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

19 lines
307 B
Go

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)
}