code: func ToJson(v interface{}) string { // nolint
  	data, err := json.Marshal(v)
  	if err != nil {
  		// Swallow errors inside of a template.
  		return ""
  	}
  	return string(data)
  }
docs: // ToJson takes an interface, marshals it to json, and returns a string. It will
  // always return a string, even on marshal error (empty string).
  //
  // This is designed to be called from a template.
  // TODO: change the function signature in Helm 3