Closed FocusHuang closed 9 months ago
Hi @FocusHuang, the buf.build/bufbuild/validate-go
plugin is for protoc-gen-validate
which is a different project.
protovalidate
(this project) does not require any code generation. You can look at the README for an example on how to perform validation.
Duplicate of https://github.com/bufbuild/protovalidate-go/issues/67#issuecomment-1785844721
Why was the code generation function of protoc-gen-validate abandoned? @nicksnyder
Description
when i use - plugin: buf.build/bufbuild/validate-go to generate validation, a *.pb.validate.go is generated, but no validation rule in function Validate or ValidateAll. if i want to use validate, i need to new a protovalidateor to validate the struct. is it excessive?
Steps to Reproduce
buf.gen.yaml
task.pb.validate.go
Expected Behavior
i can use task.Validate() or task.ValidateAll() to validate fields
Actual Behavior
all pass directly
Screenshots/Logs
Environment
Possible Solution
Additional Context