1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
11 "github.com/ghodss/yaml"
14 // DumpAndExit writes the given config to stdout as YAML. If an error
15 // occurs, that error is returned. Otherwise, the program exits 0.
19 // log.Fatal(DumpAndExit(cfg))
20 func DumpAndExit(cfg interface{}) error {
21 y, err := yaml.Marshal(cfg)
25 _, err = os.Stdout.Write(y)
30 return errors.New("exit failed!?")