MCPcopy Create free account
hub / github.com/bufbuild/buf / ImageWithOnlyPathsAllowNotExist

Function ImageWithOnlyPathsAllowNotExist

private/bufpkg/bufimage/bufimage.go:508–514  ·  view source on GitHub ↗

ImageWithOnlyPathsAllowNotExist returns a copy of the Image that only includes the files with the given root relative file paths. Note that paths can be either files or directories - whether or not a path is included is a result of normalpath.EqualsOrContainsPath. If a root relative file path does

(
	image Image,
	paths []string,
	excludePaths []string,
)

Source from the content-addressed store, hash-verified

506//
507// If a root relative file path does not exist, this skips this path.
508func ImageWithOnlyPathsAllowNotExist(
509 image Image,
510 paths []string,
511 excludePaths []string,
512) (Image, error) {
513 return imageWithOnlyPaths(image, paths, excludePaths, true)
514}
515
516// ImageByDir returns multiple images that have non-imports split
517// by directory.

Calls 1

imageWithOnlyPathsFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…