[minor] remove unneccessary make() call, more explicit variable names

This commit is contained in:
Aaron Meihm 2015-09-21 12:39:49 -05:00
Родитель 9ff0dc2422
Коммит 72be15978e
1 изменённых файлов: 11 добавлений и 12 удалений

Просмотреть файл

@ -78,25 +78,24 @@ func loadPlugins() (err error) {
} }
}() }()
pluginList = make([]plugin, 0)
// Identify any available output plugins // Identify any available output plugins
dirents, err := ioutil.ReadDir(ctx.Runner.PluginDirectory) dirents, err := ioutil.ReadDir(ctx.Runner.PluginDirectory)
if err != nil { if err != nil {
panic(err) panic(err)
} }
for _, x := range dirents { for _, pluginEnt := range dirents {
n := x.Name() pluginName := pluginEnt.Name()
m := x.Mode() pluginMode := pluginEnt.Mode()
if (m & 0111) == 0 { if (pluginMode & 0111) == 0 {
mlog("plugins: skipping %v (not executable)", n) mlog("plugins: skipping %v (not executable)", pluginName)
continue continue
} }
ppath := path.Join(ctx.Runner.PluginDirectory, n) ppath := path.Join(ctx.Runner.PluginDirectory, pluginName)
mlog("plugins: registering %v", n) mlog("plugins: registering %v", pluginName)
np := plugin{} np := plugin{
np.name = n name: pluginName,
np.path = ppath path: ppath,
}
pluginList = append(pluginList, np) pluginList = append(pluginList, np)
} }