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

Function WithModuleFormat

private/buf/buffetch/internal/internal.go:665–677  ·  view source on GitHub ↗

WithModuleFormat attaches the given format as a module format. It is up to the user to not incorrectly attach a format twice.

(format string, options ...ModuleFormatOption)

Source from the content-addressed store, hash-verified

663//
664// It is up to the user to not incorrectly attach a format twice.
665func WithModuleFormat(format string, options ...ModuleFormatOption) RefParserOption {
666 return func(refParser *refParser) {
667 format = normalizeFormat(format)
668 if format == "" {
669 return
670 }
671 moduleFormatInfo := newModuleFormatInfo()
672 for _, option := range options {
673 option(moduleFormatInfo)
674 }
675 refParser.moduleFormatToInfo[format] = moduleFormatInfo
676 }
677}
678
679// WithProtoFileFormat attaches the given format as a single file format.
680//

Callers 3

newRefParserFunction · 0.92
newModuleRefParserFunction · 0.92

Calls 3

normalizeFormatFunction · 0.85
newModuleFormatInfoFunction · 0.85
optionStruct · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…