protoc

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package protoc contains some helpers for invoking protoc from tests. This technique is used to verify that protocompile produces equivalent outputs and has equivalent behavior as protoc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryPath

func BinaryPath(rootDir string) (string, error)

BinaryPath returns the path to an appropriate protoc executable. This path is created by the Makefile, so run `make test` instead of `go test ./...` to make sure the path is populated. You can also just create the protoc executable via 'make protoc'.

The protoc executable is used by some tests to verify that the output of this repo matches the output of the reference compiler.

func Compile

func Compile(files map[string]string, fileNames []string) (stdout []byte, err error)

Compile compiles the given files with protoc. The fileNames parameter indicates the order of files that should be used in the command line for protoc (can be nil when the order does not matter).

This does not return the full results of compilation, only if compilation succeeded or not. The returned error will be an instance of *exec.ExitError if protoc was successfully invoked but returned a non-zero status.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL