[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
dirents, err := ioutil.ReadDir(ctx.Runner.PluginDirectory)
if err != nil {
panic(err)
}
for _, x := range dirents {
n := x.Name()
m := x.Mode()
if (m & 0111) == 0 {
mlog("plugins: skipping %v (not executable)", n)
for _, pluginEnt := range dirents {
pluginName := pluginEnt.Name()
pluginMode := pluginEnt.Mode()
if (pluginMode & 0111) == 0 {
mlog("plugins: skipping %v (not executable)", pluginName)
continue
}
ppath := path.Join(ctx.Runner.PluginDirectory, n)
mlog("plugins: registering %v", n)
np := plugin{}
np.name = n
np.path = ppath
ppath := path.Join(ctx.Runner.PluginDirectory, pluginName)
mlog("plugins: registering %v", pluginName)
np := plugin{
name: pluginName,
path: ppath,
}
pluginList = append(pluginList, np)
}