title: How to read a YAML file
body: <p>I have an issue with reading a YAML file.  I think it's something in the file structure but I can't figure out what.</p>
  
  <p><em>YAML file:</em></p>
  
  <pre><code>conf:
    hits:5
    time:5000000
  </code></pre>
  
  <p><em>code:</em></p>
  
  <pre><code>type conf struct {
      hits int64 `yaml:"hits"`
      time int64 `yaml:"time"`
  }
  
  
  func (c *conf) getConf() *conf {
  
      yamlFile, err := ioutil.ReadFile("conf.yaml")
      if err != nil {
          log.Printf("yamlFile.Get err   #%v ", err)
      }
      err = yaml.Unmarshal(yamlFile, c)
      if err != nil {
          log.Fatalf("Unmarshal: %v", err)
      }
  
      return c
  }
  </code></pre>