validator_gen

command
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 7 Imported by: 0

README

validator-gen

参数校验插件生成后的 pb/validator.go 文件代码如下:


    package pb
    
    import (
    	"github.com/go-playground/validator/v10"
    )
    
    var validate = validator.New()

生成后的 validator_req.go 文件如下:

    package pb
    
    // Validate req validator.
    func (r *HelloRequest) Validate() error {
    	return validate.Struct(r)
    }

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL