bufbuild / protoc-gen-validate

Protocol Buffer Validation - Being replaced by github.com/bufbuild/protovalidate
https://github.com/bufbuild/protovalidate
Apache License 2.0
3.81k stars 580 forks source link

There's not `ValidateAll` method #508

Closed yeqown closed 2 years ago

yeqown commented 3 years ago

Envrioment

lang: go1.17 protoc-gen-validate: 0.6.1 protoc: 3.17.0 proto-gen-go: 1.3.2

Question

I generated xxx.pb.validate.to but there's no ValidateAll method in it. compile command is:

    protoc \
        -I. \
        -I ../../../thirdparty \
        --go_out=plugins=grpc:. \
        --validate_out=lang=go:. \
        api.proto

here is protobuffer file: https://github.com/yeqown/cassem/blob/main/internal/cassemdb/api/api.proto. Is there any tip I missed?

image

yeqown commented 3 years ago

As supplementary, third-party is a copy of validate/validate.proto and other google/protobuf/xxx.proto

medgar-nitric commented 3 years ago

I had the same issues with go1.17, to fix the issue I had to downgrade go to 1.16

yeqown commented 3 years ago

@medgar-nitric Thanks for your reply, I wonder you mean it works correctly with 1.16? And have you found the root cause of this issue?

medgar-nitric commented 3 years ago

Sorry, yes that is what i meant with Go version 1.16 the ValidateAll() functions are generated correctly, but are not present when using Go version 1.17. I dont know what the root cause is for this.

medgar-nitric commented 3 years ago

This is fixed now with Go version 1.17.1 Not sure why.

phroggyy commented 2 years ago

This looks to not be working in Go 1.19.2