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

Function ModuleDirectModuleDeps

private/bufpkg/bufmodule/module.go:215–224  ·  view source on GitHub ↗

ModuleDirectModuleDeps is a convenience function that returns only the direct dependencies of the Module.

(module Module)

Source from the content-addressed store, hash-verified

213
214// ModuleDirectModuleDeps is a convenience function that returns only the direct dependencies of the Module.
215func ModuleDirectModuleDeps(module Module) ([]ModuleDep, error) {
216 moduleDeps, err := module.ModuleDeps()
217 if err != nil {
218 return nil, err
219 }
220 return xslices.Filter(
221 moduleDeps,
222 func(moduleDep ModuleDep) bool { return moduleDep.IsDirect() },
223 ), nil
224}
225
226// *** PRIVATE ***
227

Callers 2

addModuleToGraphRecFunction · 0.92
moduleSetToDAGRecFunction · 0.85

Calls 3

ModuleDepsMethod · 0.65
FilterMethod · 0.65
IsDirectMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…