mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 07:57:07 +00:00
20 lines
307 B
Go
20 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)
|
||
|
}
|