-
Notifications
You must be signed in to change notification settings - Fork 160
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
validator generate incorrect type #51
Comments
I found that go-proto-validators calls following method. |
Hello. I am picking up this repo so apologies for the long delay in responding to your issue. Having a bit more details would help narrow down to what the issue is.
|
This problem still exists. See https://github.com/vegaprotocol/testprotosize for a test repo. Protosyntax = "proto3";
package proto;
option go_package = "[somerepo]/proto";
import "github.com/mwitkow/go-proto-validators/validator.proto";
message ThingWithSize {
uint64 size = 1 [(validator.field) = {int_gt: 0}];
} Script to generatecd proto
protoc \
-I. \
-Ivendor \
-Ivendor/github.com/protocolbuffers/protobuf/src \
--go_out=plugins=grpc,paths=source_relative:. \
--govalidators_out=paths=source_relative:. \
testsize.proto Generated validatorfunc (this *ThingWithSize) Validate() error {
if !(this.Size_ > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Size_", fmt.Errorf(`value '%v' must be greater than '0'`, this.Size_))
}
return nil
} Note: The check is on a non-existent field Compile error
Versions
|
@mwitkow / @Helcaraxan Any chance one of you can look at this one again, please? |
@mwitkow / @Helcaraxan ⌛ Any chance one of you can look at this one again, please? |
@mwitkow / @Helcaraxan ⌛ 😸 |
bug still exists |
in my message is have
when i'm try to generate code
why filed name changed from Size to Size_ ?
The text was updated successfully, but these errors were encountered: