title: Golang - Unit test for parse yaml file and check objects
body: <p>I want to test parse of yaml and test it via unit test
  I’ve create structs that with appropriate types but the assertion is always 
  falid, I try with the following code which failed constantly </p>
  
  <p>This is the yaml content which is <strong>valid</strong>  (maybe with the copy it changed but I was able to parse it correctly)</p>
  
  <pre><code>ID: demo
  version: 0.0.5
  
  dep:
   - name: db
     path: mtb
     requires:
      - name: vi_db
  
  
   - name: srv
     path: srv1
     properties:
       LOG_LEVEL: "info"
  
  
     parameters:
       mem: 12G
     requires:
       - name: db
         properties:
  </code></pre>
  
  <p>This is the test I was created  </p>
  
  <pre><code>    func Test_parseFile(t *testing.T) {
  
          yamlfile, err := ioutil.ReadFile("./testdata/file.yaml")
  
          type Properties map[string]string
          type Parameters map[string]interface{}
  
          type Modules struct {
              Name string
              Path string `yaml:"path,omitempty"`
              Requires   []Requires `yaml:"requires,omitempty"`
              Properties Properties `yaml:"properties,omitempty"`
          }
  
     type Requires struct {
        Name       string     `yaml:"name,omitempty"`
        Properties Properties `yaml:"properties,omitempty"`
      }
  
  
  
      type args struct {
          contentFile []byte
      }
  
  
       tests := []struct {
              name        string
              args        args
              wantOut     Properties
              wantNoTests bool
              wantErr     bool
          }{
              {
                  name: "test",
                  args: args{
                      contentFile: yamlfile,
                  },
  
                  wantOut: Modules{
                      Name: "srv",
                      Path: "srv1",
  
                      Properties{
                          "LOG_LEVEL":       "info",
                          "DEBUG_LOG_LEVEL": "ALL",
                      },
                      Parameters:{
                          "mem":"12G",
                      },
                      Requires: {
                          name: "db",
                          Properties{
                              "CONFIG": '[tomcontext.xml:
                              {"service_nameDB" : "~{con-name}"}]'   
                          },
                      },
                  },
  
                  wantNoTests: true,
                  wantErr:     true,
              },
          }
  </code></pre>
  
  <p>This is the assertion code</p>
  
  <pre><code>for _, tt := range tests {
          t.Run(tt.name, func(t *testing.T) {
  
              gotOut := ParseFile(tt.args.contentFile)
  
  
              if !reflect.DeepEqual(gotOut.Modules[1], tt.wantOut) {
  
                  t.Errorf("parseFile() = %v, want %v", gotOut.Modules[2], tt.wantOut)
              }
  </code></pre>
  
  <p>The error is : </p>
  
  <pre><code>parseFile() = map[], want map[LOG_LEVEL:info DEBUG_LOG_LEVEL:ALL]
  </code></pre>
  
  <p>How should I overcome it to check the module properties ? </p>
  
  <p>The <code>ParseFile</code> method is just <code>err := yaml.Unmarshal([]byte(yamlFile), &amp;yamlconent)</code></p>