code: func (r replacer) Replace(s string) string {
  	// Header replacements - these are case-insensitive, so we can't just use strings.Replace()
  	for strings.Contains(s, headerReplacer) {
  		idxStart := strings.Index(s, headerReplacer)
  		endOffset := idxStart + len(headerReplacer)
  		idxEnd := strings.Index(s[endOffset:], "}")
  		if idxEnd > -1 {
  			placeholder := strings.ToLower(s[idxStart : endOffset+idxEnd+1])
  			replacement := r.replacements[placeholder]
  			if replacement == "" {
  				replacement = r.emptyValue
  			}
  			s = s[:idxStart] + replacement + s[endOffset+idxEnd+1:]
  		} else {
  			break
  		}
  	}
  
  	// Regular replacements - these are easier because they're case-sensitive
  	for placeholder, replacement := range r.replacements {
  		if replacement == "" {
  			replacement = r.emptyValue
  		}
  		s = strings.Replace(s, placeholder, replacement, -1)
  	}
  
  	return s
  }
docs: // Replace performs a replacement of values on s and returns
  // the string with the replaced values.