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

Function printModule

private/bufpkg/bufmodule/bufmoduledebug/bufmoduledebug.go:76–109  ·  view source on GitHub ↗
(ctx context.Context, printer indent.Printer, module bufmodule.Module)

Source from the content-addressed store, hash-verified

74}
75
76func printModule(ctx context.Context, printer indent.Printer, module bufmodule.Module) error {
77 fileInfos, err := bufmodule.GetFileInfos(ctx, module)
78 if err != nil {
79 return err
80 }
81 moduleDeps, err := module.ModuleDeps()
82 if err != nil {
83 return err
84 }
85 printer.P("module:")
86 printer.In()
87 printer.Pf("name: %s", module.OpaqueID())
88 printer.Pf("target: %v", module.IsTarget())
89 printer.Pf("local: %v", module.IsLocal())
90 printer.P("deps:")
91 printer.In()
92 for _, moduleDep := range moduleDeps {
93 printer.Pf("name:", moduleDep.OpaqueID())
94 printer.Pf("direct: %v", moduleDep.IsDirect())
95 }
96 printer.Out()
97 printer.P("files:")
98 printer.In()
99 for _, fileInfo := range fileInfos {
100 printer.Pf("%s:", fileInfo.Path())
101 printer.In()
102 printer.Pf("target: %v", fileInfo.IsTargetFile())
103 printer.Pf("external_path: %s", fileInfo.ExternalPath())
104 printer.Out()
105 }
106 printer.Out()
107 printer.Out()
108 return nil
109}

Callers 2

ModuleSetDebugStringFunction · 0.85
ModuleDebugStringFunction · 0.85

Calls 13

GetFileInfosFunction · 0.92
ModuleDepsMethod · 0.65
PMethod · 0.65
InMethod · 0.65
PfMethod · 0.65
OpaqueIDMethod · 0.65
IsTargetMethod · 0.65
IsLocalMethod · 0.65
IsDirectMethod · 0.65
OutMethod · 0.65
PathMethod · 0.65
IsTargetFileMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…