code: func Parse(rawtemplate string) (template *UriTemplate, err error) {
  	template = new(UriTemplate)
  	template.raw = rawtemplate
  	split := strings.Split(rawtemplate, "{")
  	template.parts = make([]templatePart, len(split)*2-1)
  	for i, s := range split {
  		if i == 0 {
  			if strings.Contains(s, "}") {
  				err = errors.New("unexpected }")
  				break
  			}
  			template.parts[i].raw = s
  		} else {
  			subsplit := strings.Split(s, "}")
  			if len(subsplit) != 2 {
  				err = errors.New("malformed template")
  				break
  			}
  			expression := subsplit[0]
  			template.parts[i*2-1], err = parseExpression(expression)
  			if err != nil {
  				break
  			}
  			template.parts[i*2].raw = subsplit[1]
  		}
  	}
  	if err != nil {
  		template = nil
  	}
  	return template, err
  }
docs: // Parse parses a URI template string into a UriTemplate object.