您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

20 行
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. }