code: func formatErrorDescription(s string, details ErrorDetails) string {
  
  	var tpl *template.Template
  	var descrAsBuffer bytes.Buffer
  	var err error
  
  	errorTemplates.RLock()
  	tpl = errorTemplates.Lookup(s)
  	errorTemplates.RUnlock()
  
  	if tpl == nil {
  		errorTemplates.Lock()
  		tpl = errorTemplates.New(s)
  
  		if ErrorTemplateFuncs != nil {
  			tpl.Funcs(ErrorTemplateFuncs)
  		}
  
  		tpl, err = tpl.Parse(s)
  		errorTemplates.Unlock()
  
  		if err != nil {
  			return err.Error()
  		}
  	}
  
  	err = tpl.Execute(&descrAsBuffer, details)
  	if err != nil {
  		return err.Error()
  	}
  
  	return descrAsBuffer.String()
  }
docs: // formatErrorDescription takes a string in the default text/template
  // format and converts it to a string with replacements. The fields come
  // from the ErrorDetails struct and vary for each type of error.