~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/googleapi/internal/uritemplates/utils.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package uritemplates
 
2
 
 
3
func Expand(path string, expansions map[string]string) (string, error) {
 
4
        template, err := Parse(path)
 
5
        if err != nil {
 
6
                return "", err
 
7
        }
 
8
        values := make(map[string]interface{})
 
9
        for k, v := range expansions {
 
10
                values[k] = v
 
11
        }
 
12
        return template.Expand(values)
 
13
}