in custard/pkg/config/config.go [71:89]
func LoadConfig(path string) (*Config, error) {
// Set the config default values.
config := Config{
Match: []string{"*"},
}
// This mutates `config` so there's no need to reassign it.
// It keeps the default values if they're not in the JSON file.
err := readJsonc(path, &config)
if err != nil {
return nil, err
}
// Validate for required values.
if config.PackageFile == nil {
return nil, errors.New("package-file is required")
}
return &config, nil
}