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

Function ImageWithOnlyPaths

private/bufpkg/bufimage/bufimage.go:493–499  ·  view source on GitHub ↗

ImageWithOnlyPaths returns a copy of the Image that only includes the files with the given root relative file paths or directories. 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 do

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

Source from the content-addressed store, hash-verified

491//
492// If a root relative file path does not exist, this errors.
493func ImageWithOnlyPaths(
494 image Image,
495 paths []string,
496 excludePaths []string,
497) (Image, error) {
498 return imageWithOnlyPaths(image, paths, excludePaths, false)
499}
500
501// ImageWithOnlyPathsAllowNotExist returns a copy of the Image that only includes the files
502// with the given root relative file paths.

Callers 4

TestGoogleapisFunction · 0.92
TestBasicFunction · 0.92
ImageByDirFunction · 0.85

Calls 1

imageWithOnlyPathsFunction · 0.85

Tested by 2

TestGoogleapisFunction · 0.74
TestBasicFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…