Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Latest commit

 

History

History
28 lines (18 loc) · 713 Bytes

govalidator.md

File metadata and controls

28 lines (18 loc) · 713 Bytes

govalidator

Generated code for validate field for protobuf message.

Dependency

github.com/golang/protobuf v1.5.2

Installation

go get -u -d github.com/yu31/proto-go-plugin

go install github.com/yu31/proto-go-plugin/cmd/protoc-gen-govalidator

Example

The proto file see govalidator_test.proto

And generated by

protoc -I=. -I="${GOPATH}"/src --go_opt=paths=source_relative --govalidator_opt=paths=source_relative --go_out=. --govalidator_out=. ./tests/govalidatortest/govalidator_test.proto

The code generated see govalidator_test.validator.pb.go