func FromFile()

in internal/changelog/file.go [14:26]


func FromFile(fs afero.Fs, inFile string) (Changelog, error) {
	b, err := afero.ReadFile(fs, inFile)
	if err != nil {
		return Changelog{}, fmt.Errorf("cannot read file: %s", inFile)
	}

	c := Changelog{}
	if err := yaml.Unmarshal(b, &c); err != nil {
		return Changelog{}, fmt.Errorf("cannot parse changelog YAML from file: %s", inFile)
	}

	return c, nil
}