You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
247B

  1. package config
  2. import (
  3. "os"
  4. "gopkg.in/yaml.v3"
  5. )
  6. // Save writes the current config back to disk.
  7. func Save(path string, cfg Config) error {
  8. b, err := yaml.Marshal(cfg)
  9. if err != nil {
  10. return err
  11. }
  12. return os.WriteFile(path, b, 0o644)
  13. }