Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo, path, missing semicolon. #10

Merged
merged 1 commit into from
Apr 22, 2015
Merged

Fix typo, path, missing semicolon. #10

merged 1 commit into from
Apr 22, 2015

Conversation

dmitshur
Copy link
Contributor

Hi there.

First off, thanks for making this! It seems very helpful and needed.

I'm still learning about grpc and protobufs, so I may be mistaken, but I think there were a few issues in the README that I had to figure out in order to get it to work. Please take a look.

I think they are valid fixes.

The first change:

@@ -73,14 +73,14 @@ Make sure that your `$GOPATH/bin` is in your `$PATH`.
    +    option (gengo.grpc.gateway.ApiMethodOptions.api_options) = {
    +      path: "/v1/example/echo"
    +      method: "POST"
-   +    }
+   +    };
    +  }
     }
    ```

I needed to add that semicolon, otherwise an error was being generated when running protoc command:

sample.proto:46:3: Expected ";".

Next change:

 3. Generate gRPC stub

    ```sh
-   protoc -I/usr/local/include -I. -I$GOPATH \
+   protoc -I/usr/local/include -I. -I$GOPATH/src \
      --go_out=plugins=grpc:. \
      path/to/your_service.proto
    ```

    It will generate a stub file `path/to/your_service.pb.go`.
    Now you can implement your service on top of the stub.
 4. Generate reverse-proxy

    ```sh
-   protoc -I/usr/local/include -I. -I$GOPATH \
+   protoc -I/usr/local/include -I. -I$GOPATH/src \
      --grpc-gateway_out=logtostderr=true:. \
      path/to/your_service.proto
    ```

I needed to make that change, otherwise protoc command generated this error:

sample.proto: Import "github.com/gengo/grpc-gateway/options/options.proto" was not found or had errors.

This change makes sense, as options.proto file is indeed located at $GOPATH/src/github.com/gengo/grpc-gateway/options/options.proto and not $GOPATH/github.com/gengo/grpc-gateway/options/options.proto.

The rest are just typo fixes.

@yugui
Copy link
Member

yugui commented Apr 22, 2015

Thank you!

yugui added a commit that referenced this pull request Apr 22, 2015
Fix typo, path, missing semicolon.
@yugui yugui merged commit f69df30 into grpc-ecosystem:master Apr 22, 2015
@dmitshur dmitshur deleted the patch-1 branch April 22, 2015 17:14
ithinker1991 referenced this pull request in tronprotocol/grpc-gateway Apr 26, 2018
fix: rename ParticipateAssetIssueContract.
Evgeniy-L pushed a commit to Evgeniy-L/grpc-gateway that referenced this pull request Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants