File: utils.go

package info (click to toggle)
golang-google-api 0.0~git20150609-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,232 kB
  • ctags: 21,955
  • sloc: makefile: 16
file content (13 lines) | stat: -rw-r--r-- 287 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
package uritemplates

func Expand(path string, expansions map[string]string) (string, error) {
	template, err := Parse(path)
	if err != nil {
		return "", err
	}
	values := make(map[string]interface{})
	for k, v := range expansions {
		values[k] = v
	}
	return template.Expand(values)
}