title: How to Unmarshal and Marshal YAML in Go, while preserving white space?
body: <p>I have a YAML like</p>
  
  <pre><code>data:
    label1:
      - someval1
      - someval2
    label2:
      - otherval1
      - otehrval2
  </code></pre>
  
  <p>Using YAML parser "gopkg.in/yaml.v2"</p>
  
  <pre><code>yaml.Unmarshal([]byte(yamlStr), &amp;yamlObj)
  
  # Some works and changes to yamlObj
  
  s, _ := yaml.Marshal(&amp;yamlObj)
  fmt.Println(string(s))
  </code></pre>
  
  <p>This outputs:</p>
  
  <pre><code>data:
    label1:
    - someval1
    - someval2
    label2:
    - otherval1
    - otehrval2
  </code></pre>
  
  <p>The resulted YAML is correct but for my task I need lists (<code>- values</code>) indented as in original YAML. Is there a way to preserve those spaces and new lines?</p>