mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
703f7a7666
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
19 lines
307 B
Go
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)
|
|
}
|