title: Converting a JSON dir tree into indented plain text in GoLang
body: <p>I have a dir tree in a JSON struct that I'm trying to format in plain text. Formatting it in XML or YAML is pretty easy. Formatting it in plain text is much harder than I thought. </p>
  
  <p>The JSON struct is formatted like this :</p>
  
  <pre><code>type File struct {
     Name     string  `json:"Name"`
     Children []*File `json:"Children"`
  }
  </code></pre>
  
  <p>Since the JSON structure allows for 'children', the JSON is nested, and since it's a dir tree, I don't know how deep the nesting will get (within reason).</p>
  
  <p>I need the converted JSON to look like this :</p>
  
  <pre><code>base_dir
    sub_dir_1
    sub_dir_2
      file_in_sub_dir_2
    sub_dir_3
    ...
  </code></pre>
  
  <p>Can anyone tell me how this could be done in a reasonably simple way? Right now I'm having to brute force with lots of looping and indenting with tabs, and I'm just sure there's a more elegant way in Go.</p>