github.com/devseccon/trivy@v0.47.1-0.20231123133102-bd902a0bd996/pkg/x/path/path.go (about)

     1  package path
     2  
     3  import (
     4  	"strings"
     5  
     6  	"golang.org/x/exp/slices"
     7  )
     8  
     9  // Contains reports whether the path contains the subpath.
    10  func Contains(filePath, subpath string) bool {
    11  	ss := strings.Split(filePath, "/")
    12  	return slices.Contains(ss, subpath)
    13  }