code: func (o *Options) IsOriginAllowed(origin string, req *http.Request) (allowed bool) {
  	if o.ShouldAllowOrigin != nil {
  		return o.ShouldAllowOrigin(origin, req)
  	}
  	for _, pattern := range allowOriginPatterns {
  		allowed, _ = regexp.MatchString(pattern, origin)
  		if allowed {
  			return
  		}
  	}
  	return
  }
docs: // Looks up if the origin matches one of the patterns
  // generated from Options.AllowOrigins patterns.