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

Method getModuleForFilePath

private/bufpkg/bufmodule/module_set.go:362–369  ·  view source on GitHub ↗

This should only be used by Modules and FileInfos.

(ctx context.Context, filePath string)

Source from the content-addressed store, hash-verified

360
361// This should only be used by Modules and FileInfos.
362func (m *moduleSet) getModuleForFilePath(ctx context.Context, filePath string) (Module, error) {
363 return m.filePathToModuleCache.GetOrAdd(
364 filePath,
365 func() (Module, error) {
366 return m.getModuleForFilePathUncached(ctx, filePath)
367 },
368 )
369}
370
371func (m *moduleSet) getModuleForFilePathUncached(ctx context.Context, filePath string) (_ Module, retErr error) {
372 matchingOpaqueIDToModule := make(map[string]Module)

Callers

nothing calls this directly

Calls 2

GetOrAddMethod · 0.80

Tested by

no test coverage detected