func (i *instruction) url(hsURL string, lookup *sync.Map) string {
	pathTemplate := i.path
	for k, v := range i.substitutions {
		// if the variable starts with a '.' then use the lookup table, else use the string literally
		// this handles scenarios like:
		// { $roomId: ".room_0", $eventType: "m.room.message" }
		var valToEncode string
		if v != "" && v[0] == '.' {
			vint, ok := lookup.Load(strings.TrimPrefix(v, "."))
			if ok {
				valToEncode = vint.(string)
			}
		} else {
			valToEncode = v
		}
		pathTemplate = strings.Replace(pathTemplate, k, url.PathEscape(valToEncode), -1)
	}
	return hsURL + pathTemplate
}
// url returns the complete path resolved url for this instruction. Query parameters must be
// added separately.
url returns the complete path resolved url for this instruction. Query parameters must be
added separately.
// url returns the complete path resolved url for this instruction . Query parameters must be // added separately .
func (i *instruction) url(hsURL string, lookup *sync.Map) string {
	pathTemplate := i.path
	for k, v := range i.substitutions {
		var valToEncode string
		if v != "" && v[0] == '.' {
			vint, ok := lookup.Load(strings.TrimPrefix(v, "."))
			if ok {
				valToEncode = vint.(string)
			}
		} else {
			valToEncode = v
		}
		pathTemplate = strings.Replace(pathTemplate, k, url.PathEscape(valToEncode), -1)
	}
	return hsURL + pathTemplate
}
func ( i * instruction ) url ( hsURL string , lookup * sync . Map ) string { pathTemplate := i . path for k , v := range i . substitutions { var valToEncode string if v != " " && v [ 0 ] == '.' { vint , ok := lookup . Load ( strings . TrimPrefix ( v , " " ) ) if ok { valToEncode = vint . ( string ) } } else { valToEncode = v } pathTemplate = strings . Replace ( pathTemplate , k , url . PathEscape ( valToEncode ) , - 1 ) } return hsURL + pathTemplate }
url returns the complete path resolved url for this instruction.
url returns the complete path resolved url for this instruction .
// if the variable starts with a '.' then use the lookup table, else use the string literally // this handles scenarios like: // { $roomId: ".room_0", $eventType: "m.room.message" }