func parseManifest(file io.Reader) (yamlMap generic.Map, err error) { yamlBytes, err := ioutil.ReadAll(file) if err != nil { return } document, err := gamble.Parse(string(yamlBytes)) if err != nil { return } yamlMap = generic.NewMap(document) return }
func parseManifest(file io.Reader) (yamlMap generic.Map, err error) { yamlBytes, err := ioutil.ReadAll(file) if err != nil { return } document, err := gamble.Parse(string(yamlBytes)) if err != nil { return } if !generic.IsMappable(document) { err = errors.New("Invalid manifest. Expected a map") return } yamlMap = generic.NewMap(document) return }