Skip to content
Node: z.number().min(18)github.com/sahilkhaire/gox/validate

Int

Overview

If you are coming from Node.js, the closest pattern is z.number().min(18).

Signature

go
func Int() *intField

Compare: Node.js · Standard Go · gox

js
z.number().min(18)
go
field := validate.String().Email() // fluent schema builder
go
import "github.com/sahilkhaire/gox/validate"

field := validate.Int().Min(18)

Example

go
import "github.com/sahilkhaire/gox/validate"

field := validate.Int().Min(18)

Tips

Import github.com/sahilkhaire/gox/validate and call Int directly. See the comparison below for the standard library equivalent.

Standard library alternative

Use the standard library directly:

go
field := validate.String().Email() // fluent schema builder

Back to validate package overview

MIT Licensed · Built for Node.js developers moving to Go