Skip to content

Commit 7facf64

Browse files
author
Zakariah Chitty
committed
[docs] add justification for SetURLVars and description of alternative approach to setting url vars
1 parent efdbac1 commit 7facf64

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

test_helpers.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
5+
package mux
6+
7+
import "net/http"
8+
9+
// SetURLVars sets URL variables. This can be used to simplify the testing of
10+
// request handlers.
11+
// Alternatively, URL variables can be set by making a route that captures the
12+
// required variables, starting a server and sending the request to that
13+
// server.
14+
func SetURLVars(r *http.Request, val map[string]string) *http.Request {
15+
return setVars(r, val)
16+
}

testing.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)