Gos
- Download to your project:
go get github.com/wuriyanto48/gos
package main
import(
"fmt"
"github.com/wuriyanto48/gos"
)
func main() {
g := gos.New(`\%$()}&"':`, true, true, true)
input := `&:wuriyanto0 alex`
err := g.Validate(input)
if err != nil {
fmt.Println("DO SOMETHING WITH ERROR")
}
}
g := gos.New(`\%$()}&"':`, true, true, true)
- First Parameter
\%$()}&"':
: Allowed input to your string - Second Parameter
boolean
: Allow empty to your string, which mean your input can be empty ("") - Third Parameter
boolean
: Allow Number to your string - Fourth Parameter
boolean
: Allow Alpabetical to your string