Generate Go code
A minimal EasyP v1 generator using Go plugins.
Declare the source root in protobuf.mod:
module github.com/acme/contracts
roots protoSelect that module and the plugins in easyp.gen.yaml:
version: v1
generate:
modules: [github.com/acme/contracts]
plugins:
- name: go
out: ./gen/go
opts:
paths: source_relative
- name: go-grpc
out: ./gen/go
opts:
paths: source_relativeRun easyp generate. If protoc-gen-go or protoc-gen-go-grpc is on PATH, EasyP uses that executable; otherwise it uses the corresponding bundled WASM plugin. A go_package option in each source file, or a managed options.go.package_prefix, supplies the Go import path. See the managed options reference.
For example, adding options.go.package_prefix: github.com/acme/contracts/gen/go maps the protobuf package common.v1 to github.com/acme/contracts/gen/go/common/v1. With paths: source_relative, the generated files go to gen/go/common/v1, keeping directories aligned with the Go imports.
The go and go-grpc names identify plugins; the v1 generator has no generate.inputs or --path option. Its inputs come from the selected module's roots.