Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

20 righe
758 B

  1. // Copyright 2012 The Gorilla Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package mux
  5. import "net/http"
  6. // SetURLVars sets the URL variables for the given request, to be accessed via
  7. // mux.Vars for testing route behaviour. Arguments are not modified, a shallow
  8. // copy is returned.
  9. //
  10. // This API should only be used for testing purposes; it provides a way to
  11. // inject variables into the request context. Alternatively, URL variables
  12. // can be set by making a route that captures the required variables,
  13. // starting a server and sending the request to that server.
  14. func SetURLVars(r *http.Request, val map[string]string) *http.Request {
  15. return setVars(r, val)
  16. }