Skip to content

Comments

add type constraints to number and stringbytes functions#1

Open
nikpivkin wants to merge 1 commit intolyonnee:mainfrom
nikpivkin:constraints
Open

add type constraints to number and stringbytes functions#1
nikpivkin wants to merge 1 commit intolyonnee:mainfrom
nikpivkin:constraints

Conversation

@nikpivkin
Copy link

This PR will allow the use of defined types, which are subtypes of numbers, strings, and bytes in some validators.

type myStirng string

func main() {
	hvalid.Validate(myStirng("ff"), hvalid.MinLen[myStirng](3))
}

Signed-off-by: Nikita Pivkin <nikita.pivkin@smartforce.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant