title: Convert struct to json array instead of json object
body: <p>I apologise in advance if this question is considered too easy or whatever; this is the first time I'm writing anything in go. I have two structs (simplified for this question)</p>
  
  <pre><code>type A struct {
      Content string
  }
  
  type B struct {
      Element A `json:"0"`
      Children []B `json:"1"`
  }
  </code></pre>
  
  <p>I want to encode a value of type <code>B</code> into JSON, but instead of returning an object it should return a json array</p>
  
  <p>For example:</p>
  
  <p>What I get: </p>
  
  <pre><code>[
      {
          "0":{
              "Content":"AAA"
          },
          "1":[
              {
                  "0":{
                      "Content":"BBB"
                  },
                  "1":[
                      {
                          "0":{
                              "Content":"CCC"
                          },
                          "1":[]
                      },
                      {
                          "0":{
                              "Content":"DDD"
                          },
                          "1":[]
                      }
                  }
              ]
          ]
      }
  ]
  </code></pre>
  
  <p>What I need:</p>
  
  <pre><code>[
      {"Content": "AAA"}, 
      [
          [
              {"Content": "BBB"},
              [
                  {"Content": "CCC"}, 
                  []
              ]
          ], 
          [
              {"Content": "DDD"}, 
              []
          ]
      ]
  ]
  </code></pre>
  
  <p>I could do this by manually iterating through it, but I would hope that there's an integrated way to do it</p>