title: Struct to CSV data as string without creating CSV file
body: <p>I have a <code>struct</code> which I want to convert into a CSV string. I don't have to write the CSV file. I just need to create the CSV string. </p>
  
  <p>The Go CSV package (<a href="https://golang.org/pkg/encoding/csv/" rel="nofollow noreferrer">https://golang.org/pkg/encoding/csv/</a>) only provides the writing facility.</p>
  
  <p>Here's the <code>struct</code>:</p>
  
  <pre><code>type myData struct {
      A string `json:"a"`
      B string `json:"b"`
      C string `json:"c"`
  }
  </code></pre>
  
  <p>CSV:</p>
  
  <pre><code>1,2,3
  4, ,6
  </code></pre>
  
  <p>I wanted a CSV string so that I can directly upload the string as a file in cloud storage via a serverless environment. So, I want to avoid creating a file in serverless environment.</p>
  
  <p>Is there any package that can help in doing this?</p>