Skip to content

Commit

Permalink
Updated import paths, README and CONTRIBUTING.
Browse files Browse the repository at this point in the history
Evgeny Khabarov authored and ekhabarov committed Jan 10, 2020
1 parent 85b42bd commit de3573d
Showing 5 changed files with 88 additions and 72 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -13,6 +13,5 @@ process of contribution:
# Developers tools
- [Protocol buffers compiler (protoc)](https://github.com/protocolbuffers/protobuf) - Google's data interchange format.
- [protoc-gen-gogofaster](https://github.com/gogo/protobuf/tree/master/protoc-gen-gogofaster) - protoc plugin implements Go bindings for protocol buffers.
- [goimports](golang.org/x/tools/cmd/goimports) - Command goimports updates your Go import lines, adding missing ones and removing unreferenced ones.
- [dep](https://github.com/golang/dep#installation) - Go dependency management tool. Yeah, we still use vendor.
- [goimports](https://golang.org/x/tools/cmd/goimports) - Command goimports updates your Go import lines, adding missing ones and removing unreferenced ones.
- [Ginkgo](https://github.com/onsi/ginkgo#set-me-up) - BDD Testing Framework for Go.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ LDFLAGS= -ldflags '-X github.com/bold-commerce/protoc-gen-struct-transformer/gen

re-generate-example:
protoc \
--proto_path=vendor/github.com/gogo:. \
--proto_path=$(GOPATH)/pkg/mod/github.com/gogo:. \
--struct-transformer_out=package=transform,debug=false,helper-package=helpers:. \
--gogofaster_out=Moptions/annotations.proto=github.com/bold-commerce/protoc-gen-struct-transformer/options:. \
./example/message.proto
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -17,6 +17,9 @@
* [Run protoc](#run-protoc)
* [Use generated functions in your gRPC server implementation.](#use-generated-functions-in-your-grpc-server-implementation)
* [CLI parameters](#cli-parameters)
* [Troubleshooting](#troubleshooting)
* [make generate returns an error](#make-generate-returns-an-error)
* ["protobuf@v1.3.1/gogoproto/gogo.proto" was not found or had errors.](#protobufv131gogoprotogogoproto-was-not-found-or-had-errors)

<!-- vim-markdown-toc -->

@@ -154,6 +157,7 @@ which should be placed into $PATH to be available for `protoc`.
If you're going to make changes to plugin, use `go get ...` or `git clone ...`

```shell
% export GO111MODULE=on
% go get -u -d github.com/bold-commerce/protoc-gen-struct-transformer
% cd $GOPATH/src/github.com/bold-commerce/protoc-gen-struct-transformer
// make changes
@@ -259,3 +263,15 @@ Usage of protoc-gen-struct-transformer:
-version
Print current version.
```
## Troubleshooting

### make generate returns an error
#### "protobuf@v1.3.1/gogoproto/gogo.proto" was not found or had errors.
`gogo.proto` file which is used for gogo-specific options is imported from
go modules cache. In order to fill out the cache run:

```shell
% export GO111MODULE=on
% go build
```
and run `make generate` again.
137 changes: 69 additions & 68 deletions example/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/message.proto
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ option (transformer.go_models_file_path) = "example/model/model.go";
option go_package = "example"; // Package name for pb.go

import "options/annotations.proto";
import "protobuf/gogoproto/gogo.proto"; // for gogoproto options
import "protobuf@v1.3.1/gogoproto/gogo.proto"; // for gogoproto options
import "google/protobuf/timestamp.proto";

message TheOne{

0 comments on commit de3573d

Please sign in to comment.