woodpecker/yaml/yaml.go

17 lines
255 B
Go
Raw Normal View History

2015-09-30 01:21:17 +00:00
package yaml
import (
"gopkg.in/yaml.v2"
)
type Config struct {
Debug bool `yaml:"debug"`
Branches []string `yaml:"branches"`
}
func Parse(raw string) (*Config, error) {
c := &Config{}
err := yaml.Unmarshal([]byte(raw), c)
return c, err
}