summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/olivere/elastic.v5/uritemplates/utils.go
blob: 399ef4623698be7b00eaddbb84608355e9ae0bed (plain)
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)
}