Exemple #1
0
func nodes(c []byte, r Reporter) {
	var config node
	if err := goyaml.Unmarshal(c, &config); err != nil {
		return
	}
	checkNode(config, validNodes, r, string(c), 0)
}
Exemple #2
0
func syntax(c []byte, r Reporter) {
	if err := goyaml.Unmarshal(c, &struct{}{}); err != nil {
		matches := goyamlError.FindStringSubmatch(err.Error())
		if l, err := strconv.Atoi(matches[1]); err == nil {
			m := matches[2]
			r.Error(l, m)
		} else {
			panic(err)
		}
	}
}