func NewPure(handler http.Handler) http.Handler {
	return New(handler)
}
The same as New(), but has an interface return type.
package nosurf
import (
	"errors"
	"net/http"
	"net/url"
	"regexp"
)
const (
	CookieName = "csrf_token"
	FormFieldName = "csrf_token"
	HeaderName = "X-CSRF-Token"
	FailureCode = 400
	MaxAge = 365 * 24 * 60 * 60
)
var safeMethods = []string{"GET", "HEAD", "OPTIONS", "TRACE"}
var (
	ErrNoReferer  = errors.New("A secure request contained no Referer or its value was malformed")
	ErrBadReferer = errors.New("A secure request's Referer comes from a different Origin" +
		" from the request's URL")
	ErrBadToken = errors.New("The CSRF token in the cookie doesn't match the one" +
		" received in a form/header.")
)
type CSRFHandler struct {
	successHandler http.Handler
	failureHandler http.Handler
	baseCookie http.Cookie
	exemptPaths []string
	exemptRegexps []*regexp.Regexp
	exemptGlobs []string
	exemptFunc func(r *http.Request) bool
}
func defaultFailureHandler(w http.ResponseWriter, r *http.Request) {
	w.WriteHeader(FailureCode)
}
func New(handler http.Handler) *CSRFHandler {
	baseCookie := http.Cookie{}
	baseCookie.MaxAge = MaxAge
	csrf := &CSRFHandler{successHandler: handler,
		failureHandler: http.HandlerFunc(defaultFailureHandler),
		baseCookie:     baseCookie,
	}
	return csrf
}