7 "github.com/ghodss/yaml"
10 // DumpAndExit writes the given config to stdout as YAML. If an error
11 // occurs, that error is returned. Otherwise, the program exits 0.
15 // log.Fatal(DumpAndExit(cfg))
16 func DumpAndExit(cfg interface{}) error {
17 y, err := yaml.Marshal(cfg)
21 _, err = os.Stdout.Write(y)
26 return errors.New("exit failed!?")