-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Error to build project with go module #846
Comments
This implies a version difference between the generator and the runtime library. Are you using vendor to make sure that the generator version is the correct version? your go mod file looks fine, but if you look at the 1.6.4 tree the runtime has the new methods, so it looks like you're using an old generator? |
I try to vendoring using :
but i've got this error :
So i've install using I've got a shell script which generate files : #!/usr/bin/env bash
# generate the gRPC code
function generate_grpcgw {
pushd $1
echo "> Generate gRPC for $1"
rm -rf *.pb.go
protoc -I /usr/local/include -I . -I ../../vendor -I ../googleapis \
--go_out=plugins=grpc:. *.proto
rm -rf *.pb.gw.go
echo "> Generate gRPC Gateway for $1"
protoc -I /usr/local/include -I . -I ../../vendor -I ../googleapis \
--grpc-gateway_out=logtostderr=true:. *.proto
echo "> Generate Swagger for $1"
rm -rf ../swagger/*.swagger.json
protoc -I /usr/local/include -I . -I ../../vendor -I ../googleapis \
--swagger_out=logtostderr=true:. *.proto
popd
}
function generate_grpc {
pushd $1
echo "> Generate gRPC for $1"
rm -rf *.pb.go
protoc -I /usr/local/include -I . -I ../../vendor -I ../googleapis \
--go_out=plugins=grpc:. *.proto
popd
}
function generate_swagger {
echo "> Generate Swagger"
find . -name "*.json" | xargs -I '{}' mv '{}' swagger/
rm -f swagger/api.swagger.json
go run ./swagger/swagger.go swagger > swagger/api.swagger.json
}
generate_grpcgw v1
generate_grpc health
generate_grpc info
generate_swagger |
Well, the only thing I can think of is if you have an old installation of Also, I doubt this is an issue with this repo so I'm going to close it. Please join the #grpc-gateway channel of the gophers slack if you need continue assistance. See https://github.com/grpc-ecosystem/grpc-gateway/blob/master/ISSUE_TEMPLATE.md#i-still-have-a-problem for more details on how to go there. |
The gRPC-Gateway project is maintained by volunteers in their spare time. Please follow these troubleshooting steps before submitting an issue.
grpc-gateway
library to the latest version from github:protoc-gen-grpc-gateway
andprotoc-gen-swagger
binary from yourPATH
,and reinstall the latest versions:
I install binaries like that :
I still have a problem!
I generate go files from protobuf.
When i try to compile i've got this error :
In the
go.mod
file i've got :Any idea how fix that ? Is it an error from versions ?
Thanks.
The text was updated successfully, but these errors were encountered: