Giter Club home page Giter Club logo

Comments (7)

ledmonster avatar ledmonster commented on August 22, 2024

I found that go-proto-validators calls following method.

from go-proto-validators.

Helcaraxan avatar Helcaraxan commented on August 22, 2024

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.

  • Is it still reproducible with the most recent version of go-proto-validators?
  • How can we achieve a minimal reproduction? With what .proto file and what protobuf toolchain / version?

from go-proto-validators.

ashleyvega avatar ashleyvega commented on August 22, 2024

This problem still exists.

See https://github.com/vegaprotocol/testprotosize for a test repo.

Proto

syntax = "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 generate

cd 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 validator

func (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 Size_.

Compile error

proto/testsize.validator.pb.go:20:11: this.Size_ undefined (type *ThingWithSize has no field or method Size_)
proto/testsize.validator.pb.go:21:123: this.Size_ undefined (type *ThingWithSize has no field or method Size_)

Versions

  • go-proto-validators: v0.3.2 (32a686a)

from go-proto-validators.

ashleyvega avatar ashleyvega commented on August 22, 2024

@mwitkow / @Helcaraxan Any chance one of you can look at this one again, please?

from go-proto-validators.

ashleyvega avatar ashleyvega commented on August 22, 2024

@mwitkow / @Helcaraxan ⌛ Any chance one of you can look at this one again, please?

from go-proto-validators.

ashleyvega avatar ashleyvega commented on August 22, 2024

@mwitkow / @Helcaraxan ⌛ 😸

from go-proto-validators.

sunxunkang avatar sunxunkang commented on August 22, 2024

bug still exists

from go-proto-validators.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.