title: Golang yaml generation double entries
body: <p>I want to generate the following in yaml:</p>
  
  <pre><code>- bar: hello
  - bar: another
    pint: guiness
  
  - bar: second
    pint: ""
  </code></pre>
  
  <p>in Golang, however making the following example, I get the output below:</p>
  
  <pre><code>- bar:
    - bar: hello
    - bar: another
    pint: guiness
  - bar:
    - bar: second
    pint: ""
  </code></pre>
  
  <p>It seems the YAML Golang parser puts the names of the structs in the YAML it generates like <code>- bar:</code> and then the member array under it.  I don't want that, as it will break other things.</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "gopkg.in/yaml.v2"
      "log"
  )
  
  type bar struct {
      Bar string
  }
  
  type foo struct {
      Bars []bar  `yaml:"bar"`
      Pint string `yaml:"pint"`
  }
  
  func main() {
      f := make([]foo, 2)
      f[0].Bars = make([]bar, 2)
      f[0].Bars[0].Bar = "hello"
      f[0].Bars[1].Bar = "another"
      f[0].Pint = "guiness"
      f[1].Bars = make([]bar, 1)
      f[1].Bars[0].Bar = "second"
  
      y, err := yaml.Marshal(f)
      if err != nil {
          log.Fatalf("Marshal: %v", err)
      }
      fmt.Println(string(y))
  }
  </code></pre>
  
  <p>I wondered if there is a way to get it to generate it like the first example? </p>
  
  <p>Even if it means I have to use another YAML library.</p>