title: How to convert struct to base64 encoded string and viceversa
body: <p>Given an instance of a struct, I want to convert it into a base64 encoded string. And also decode it back into a struct.</p>
  <p>I have so far tried this for the encoding: <a href="https://play.golang.org/p/tLLQzEXAnBC" rel="nofollow noreferrer">https://play.golang.org/p/tLLQzEXAnBC</a> but keep running into the following errors:</p>
  <pre><code>./prog.go:18:20: v.JSON undefined (type Vertex has no field or method JSON)
  ./prog.go:33:9: undefined: Base64
  </code></pre>
  <p>Where am I going wrong?</p>