Files
trivy/pkg/x/path/path.go
Teppei Fukuda 983ac15f22 ci: add depguard (#6963)
Signed-off-by: knqyf263 <knqyf263@gmail.com>
2024-06-20 02:48:08 +00:00

13 lines
228 B
Go

package path
import (
"slices"
"strings"
)
// Contains reports whether the path contains the subpath.
func Contains(filePath, subpath string) bool {
ss := strings.Split(filePath, "/")
return slices.Contains(ss, subpath)
}