code: func BasicAuth(username, password string) http.HandlerFunc {
  	// Inspired by https://github.com/codegangsta/martini-contrib/blob/master/auth/
  	return func(res http.ResponseWriter, req *http.Request) {
  		if !secureCompare(req.Header.Get("Authorization"),
  			"Basic "+base64.StdEncoding.EncodeToString([]byte(username+":"+password)),
  		) {
  			res.Header().Set("WWW-Authenticate",
  				"Basic realm=\"Authorization Required\"",
  			)
  			http.Error(res, "Not Authorized", http.StatusUnauthorized)
  		}
  	}
  }
docs: // BasicAuth returns basic auth handler.