package nomino import "fmt" // Make generates a random filename. The behavior can be controlled by specifying Options // In general, the final filename will be [prefix]_[generated_string]_[original_filename]_[suffix].[extension]. // If the name generator returns an error (generally, it shouldn't), that will be returned instead. func Make(conf Config) (string, error) { name, err := conf.generator() if err != nil { return "", err } return fmt.Sprintf("%s%s%s%s%s", conf.prefix, name, conf.original, conf.suffix, conf.extension), nil }