Compare commits
2 commits
815bdbb567
...
01573ad190
| Author | SHA1 | Date | |
|---|---|---|---|
| 01573ad190 | |||
| b7a3e1c013 |
1 changed files with 3 additions and 1 deletions
|
|
@ -26,8 +26,10 @@ type URLs struct {
|
|||
Prefix string
|
||||
}
|
||||
|
||||
type Repl map[string]string
|
||||
|
||||
// Given a name and replacements, return a rendered path component of a URL
|
||||
func (urls URLs) Reverse(name string, replacements map[string]string) string {
|
||||
func (urls URLs) Reverse(name string, replacements Repl) string {
|
||||
pattern := urls.URLs[name].Path
|
||||
|
||||
for key, val := range replacements {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue