func()

in lib/ec2macosinit/config.go [27:41]


func (c *InitConfig) ReadConfig(fileLocation string) (err error) {
	// Read file
	rawConfig, err := os.ReadFile(fileLocation)
	if err != nil {
		return fmt.Errorf("ec2macosinit: error reading config file located at %s: %s\n", fileLocation, err)
	}

	// Decode from TOML to InitConfig struct
	_, err = toml.Decode(string(rawConfig), c)
	if err != nil {
		return fmt.Errorf("ec2macosinit: error decoding config: %s\n", err)
	}

	return nil
}