Skip to content

Add yaml based config for default content/options #26

@automoto

Description

@automoto

Add a yaml based configuration option.

Example of an older config

type DevLogConfig struct {
	Questions []string `yaml:"questions"`
	Other     []string `yaml:"other_section"`
}

func (c *DevLogConfig) getConfig(configFilePath string) *DevLogConfig {
	logPath := getLogContentPath(templateFilePath)
	if len(logPath) >=1 {
		yamlFile, err := ioutil.ReadFile(logPath)
		handleError(err)
		err = yaml.Unmarshal(yamlFile, c)
		handleError(err)
		return c
	}

	err := yaml.UnmarshalStrict([]byte(getDefaultQuestions()), c)
	handleError(err)
	return c
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions