func NewGeneratorWithTemplate()

in internal/corpus/generator.go [48:66]


func NewGeneratorWithTemplate(config Config, fs afero.Fs, location, templateType string) (GeneratorCorpus, error) {

	var templateTypeValue int
	if templateType == "placeholder" {
		templateTypeValue = templateTypeCustom
	} else if templateType == "gotext" {
		templateTypeValue = templateTypeGoText
	} else {
		return GeneratorCorpus{}, ErrNotValidTemplate
	}

	return GeneratorCorpus{
		config:       config,
		fs:           fs,
		templateType: templateTypeValue,
		location:     location,
		timestamp:    time.Now().Unix,
	}, nil
}