A validator module library.
go get github.com/idthings/validator
package somepkg
import (
"github.com/idthings/validator"
"net/http"
)
func formHandler(w http.ResponseWriter, r *http.Request) {
// function truncated for clarity
if !validator.IsValidEmail(r.FormValue("email")) {
http.Error(w, "Bad Request", http.StatusBadRequest)
return
}
}