title: Need to generate runtime binary encoded file in golang
body: <p>I am working on the project in which I need to generate a file as binary encoded(bytes). Thing is that, I don't want to store the file but just need the encoded data to verify with some test data.</p>
  
  <p>Here is the sample code I have <a href="https://play.golang.org/p/FKA_9fT3Nvv" rel="nofollow noreferrer">zip file</a></p>
  
  <p>Above example is for <code>zip</code> but I am not restricted to use <code>zip</code> or any file type. And here we need to have stored file to read but I don't want to store and delete the file later.</p>
  
  <p>I know it has not much efforts to ask for the help, but as an newbie, I come to that only.</p>
  
  <p>Thanks.</p>