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

Function WithProtoFileFormat

private/buf/buffetch/internal/internal.go:682–694  ·  view source on GitHub ↗

WithProtoFileFormat attaches the given format as a single file format. It is up to the user to not incorrectly attach a format twice.

(format string, options ...ProtoFileFormatOption)

Source from the content-addressed store, hash-verified

680//
681// It is up to the user to not incorrectly attach a format twice.
682func WithProtoFileFormat(format string, options ...ProtoFileFormatOption) RefParserOption {
683 return func(refParser *refParser) {
684 format = normalizeFormat(format)
685 if format == "" {
686 return
687 }
688 protoFileFormatInfo := newProtoFileFormatInfo()
689 for _, option := range options {
690 option(protoFileFormatInfo)
691 }
692 refParser.protoFileFormatToInfo[format] = protoFileFormatInfo
693 }
694}
695
696// SingleFormatOption is a single format option.
697type SingleFormatOption func(*singleFormatInfo)

Callers 4

newRefParserFunction · 0.92
newSourceRefParserFunction · 0.92

Calls 3

normalizeFormatFunction · 0.85
newProtoFileFormatInfoFunction · 0.85
optionStruct · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…