1 // Copyright 2016 The Go 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.
7 // Expand parses then expands a URI template with a set of values to produce
8 // the resultant URI. Two forms of the result are returned: one with all the
9 // elements escaped, and one with the elements unescaped.
10 func Expand(path string, values map[string]string) (escaped, unescaped string, err error) {
11 template, err := parse(path)
15 escaped, unescaped = template.Expand(values)
16 return escaped, unescaped, nil