The trim
normalizer removes the whitespaces at the beginning and at the end of the given value. It can be mixed with checkers and other normalizers when defining the validation steps for user data.
type User struct {
Username string `checkers:"trim"`
}
user := &User{
Username: " normalizer ",
}
checker.Check(user)
fmt.Println(user.Username) // CHECKER