Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseProto3String ¶
func ParseProto3String(t *testing.T, src string) *desc.FileDescriptor
ParseProto3String parses a string representing a proto file, and returns a FileDescriptor.
It adds the `syntax = "proto3";` line to the beginning of the file and chooses a filename, and then calls ParseProtoStrings.
func ParseProto3Tmpl ¶
func ParseProto3Tmpl(t *testing.T, src string, data interface{}) *desc.FileDescriptor
ParseProto3Tmpl parses a template string representing a proto file, and returns a FileDescriptor.
It parses the template using Go's text/template Parse function, and then calls ParseProto3String.
func ParseProtoStrings ¶
ParseProtoStrings parses a map representing a proto files, and returns a slice of FileDescriptors.
It dedents the string before parsing.
Types ¶
type Problems ¶
Problems is a slice of individual Problem objects.
func (Problems) Diff ¶
Diff determines whether a Problem is sufficiently similar to another to be considered equivalent, and returns a diff otherwise.
This is intended for unit tests and is intentially generous on what constitutes equality.
func (Problems) SetDescriptor ¶
func (problems Problems) SetDescriptor(d desc.Descriptor) Problems
SetDescriptor sets the given descriptor to every Problem in the slice and returns the slice back.
This is intended primarily for use in unit tests.