Goprotoc Versions Save

Library for writing protoc plugins in Go; also includes a pure-Go protoc replacement

v0.5.0

2 years ago

Package "github.com/jhump/goprotoc/plugins"

  • Adds method SupportsFeatures to the plugins.CodeGenResponse type, allowing plugins to advertise the code generation features they support. This is now necessary in order to implement a plugin that protoc will use when a file contains "proto3 optional" fields.

v0.4.0

3 years ago

Package "github.com/jhump/goprotoc/plugins"

  • Adds method GoNameOfExportedServiceDesc to the GoNames type, for computing the name of the Go symbol that represents the description of a service. This supports newer versions of code generation (as of v1.0 of protoc-gen-go-grpc), which now create these variables as exported symbols. For interop with old generated code, continue to use the GoNameOfServiceDesc function, which computes the unexported variable name used by older code generators.

v0.3.0

3 years ago

Command goprotoc

  • Fixes a panic error when using the --plugin command-line argument of the goprotoc command.
  • Allows parsing of proto sources to report many/all errors encountered instead of failing first after one error.

Package "github.com/jhump/goprotoc/plugins"

  • No longer imports "github.com/golang/protobuf/protoc-gen-go/generator", which eliminates warning spam (with deprecation notices) from newer versions of this package.
  • Adds method GoNameOfEnumVal to the GoNames type, for computing the name of the Go constant that represents an enum value.
  • Adds fields ModuleRoot and SourceRelative to the GoNames type, so that the OutputFilenameFor function can mirror functionality in protoc-gen-go when given module=... or paths=source_relative plugin arguments.

Package "github.com/jhump/goprotoc/app/goprotoc"

  • Adds a RegisterPlugin function, so that a main package that invokes this logic (to embed goprotoc) can first register in-process plugin implementations (instead of all plugins shelling out to external programs).

v0.2.0

4 years ago

Adds ImportMap field to the GoNames type. This allows users to add custom mappings of proto file names to Go package options. There is also a new method, GoPackageForFileWithOverride, that allows the caller to supply the Go package option, instead of it being looked up from the file's go_package option or the newly added ImportMap.

This allows Go-generating plugins to easily support import_path and M... arguments, like protoc-gen-go does.

v0.1.1

4 years ago

Fixes the go.mod file in this repo so it works with upcoming Go 1.13.

The upstream protoreflect dependency had a go.mod file that somehow contained a mistake in the timestamp for one of the dependencies. This is not accepted by the strict version interpretation in Go tip. So this updates to a newer version of that library that itself has a fixed go.mod file.

v0.1.0

4 years ago

Initial release. This repo is not yet mature enough to warrant a v1.0. It needs more automated tests, and there are known variances between the goprotoc program and the protoc program that are still being addressed.

However, it has enough functionality and is presently of sufficient quality to warrant a pre-1.0 release.

If you try it out and find something not working, file an issue!

Note: the attached release binaries include only the goprotoc command.