diff --git a/README.md b/README.md index 645803b16bb..2ff9583866e 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,24 @@ Some areas we hope to improve over the old generator are: - simpler, faster implementation, and - better error reporting. +Installation +------------ +`go get github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic`. +If you are using Go 1.11 and see error `cannot find main module`, see this [FAQ page](https://github.com/golang/go/wiki/Modules#why-does-installing-a-tool-via-go-get-fail-with-error-cannot-find-main-module). + +The generator works as a `protoc` plugin, get `protoc` from [google/protobuf](https://github.com/protocolbuffers/protobuf). + +Invocation +---------- +`protoc --go_gapic_out [OUTPUT_DIR] --go_gapic_opt 'package/path/url;name' a.proto b.proto` + +The `go_gapic_opt` flag is necessary because we need to know where to generated file will live. +The substring before the semicolon is the import path of the package, e.g. `github.com/username/awesomeness`. +The substring after the semicolon is the name of the package used in the `package` statement. +Idiomatically the name is last element of the path but it need not be. +For instance, the last element of the path might be the package's version, and the package would benefit +from a more descriptive name. + Disclaimer ---------- This generator is currently experimental. Please don't use it for anything mission-critical.