resonatecoop / user-api-template

Golang-based User API
MIT License
8 stars 1 forks source link

Stuck on `make generate` in Getting started directions #23

Closed peterklingelhofer closed 2 years ago

peterklingelhofer commented 2 years ago
$ make generate
buf generate --path ./proto/user/common.proto
make: buf: No such file or directory
make: *** [generate] Error 1
auggod commented 2 years ago

Please try to install this https://docs.buf.build/installation

auggod commented 2 years ago

I think we should add a link to the grpc docs https://grpc.io/docs/languages/go/quickstart/

If you have problems with plugins, make sure to update your PATH export PATH="$PATH:$(go env GOPATH)/bin"

peterklingelhofer commented 2 years ago

Just to go over everything I did. I followed this guide to add $PATH to my env variables (I have zsh so I did nano ~/.zshenv and . ~/.zshenv instead of the ~/.bash_profile reference they have in that guide.

Then to get past this error:

$ make generate
buf generate --path ./proto/user/common.proto
Failure: plugin govalidators: could not find protoc plugin for name govalidators
make: *** [generate] Error 1

Per @auggod's suggestion, I ran:

go install github.com/mwitkow/go-proto-validators/protoc-gen-govalidators

And now I'm in:

$ make generate
buf generate --path ./proto/user/common.proto
buf generate --path ./proto/user/tag.proto
buf generate --path ./proto/user/address.proto
buf generate --path ./proto/user/streetaddress.proto
buf generate --path ./proto/user/user_messages.proto
buf generate --path ./proto/user/usergroup_messages.proto
buf generate --path ./proto/user/user.proto
# Generate static assets for OpenAPI UI
statik -m -f -src third_party/OpenAPI/