Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 407 Bytes

trim.md

File metadata and controls

17 lines (12 loc) · 407 Bytes

Trim Normalizer

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