2016-03-22 18:42:33 +01:00
|
|
|
// Copyright 2016 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2015-07-20 19:44:35 +02:00
|
|
|
package uritemplates
|
|
|
|
|
2016-03-22 18:42:33 +01:00
|
|
|
func Expand(path string, values map[string]string) (string, error) {
|
|
|
|
template, err := parse(path)
|
2015-07-20 19:44:35 +02:00
|
|
|
if err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
2016-03-22 18:42:33 +01:00
|
|
|
return template.Expand(values), nil
|
2015-07-20 19:44:35 +02:00
|
|
|
}
|