Пример #1
0
func parseConfig(data []byte) (Config, error) {
	conf := map[string]interface{}{}
	err := yaml.Unmarshal(data, &conf)
	if err != nil {
		return nil, err
	}

	return conf, nil
}
Пример #2
0
// Helper function to parse the front-end yaml matter.
func parseMatter(content []byte) (Page, error) {
	page := map[string]interface{}{}
	err := yaml.Unmarshal(content, &page)
	return page, err
}