mirror of
https://github.com/davidallendj/configurator.git
synced 2025-12-20 11:37:00 -07:00
fix: changed variable name to avoid collision with package
This commit is contained in:
parent
895b539c66
commit
1f87b180b9
1 changed files with 6 additions and 6 deletions
|
|
@ -165,23 +165,23 @@ func LoadPlugins(dirpath string, opts ...Option) (map[string]Generator, error) {
|
||||||
// This function requires that a target and plugin path be set at minimum.
|
// This function requires that a target and plugin path be set at minimum.
|
||||||
func Generate(plugin string, params Params) (FileMap, error) {
|
func Generate(plugin string, params Params) (FileMap, error) {
|
||||||
var (
|
var (
|
||||||
generator Generator
|
gen Generator
|
||||||
ok bool
|
ok bool
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
// check if generator is built-in first before loading external plugin
|
// check if generator is built-in first before loading external plugin
|
||||||
generator, ok = DefaultGenerators[plugin]
|
gen, ok = DefaultGenerators[plugin]
|
||||||
if !ok {
|
if !ok {
|
||||||
// only load the plugin needed for this target if we don't find default
|
// only load the plugin needed for this target if we don't find default
|
||||||
log.Error().Msg("could not find target in default generators")
|
log.Error().Msg("could not find target in default generators")
|
||||||
generator, err = LoadPlugin(plugin)
|
gen, err = LoadPlugin(plugin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to load plugin from file: %v", err)
|
return nil, fmt.Errorf("failed to load plugin from file: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return generator.Generate(nil, params)
|
return gen.Generate(nil, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main function to generate a collection of files as a map with the path as the key and
|
// Main function to generate a collection of files as a map with the path as the key and
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue