Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

github.com/yeyudekuangxiang/validator

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/yeyudekuangxiang/validator

Source
Go
Version
v1.0.1
Version published
Created
Source

1. forked from go-playground/validator

2. 源码中required_if只能对同级元素或者子级元素进行校验 添加required_if_global校验方法可校验任何层级

3. 使用方法

package main

type Address struct {
	SendAddress struct{
		Province string
	}
	ReceiveAddress struct{
		Province string `validate:"required_if_global=SendAddress.Province shanghai"`
	}
}

FAQs

Package last updated on 08 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts