Skip to content

Commit e3e5b8b

Browse files
committed
fix: format the file
1 parent 37fad87 commit e3e5b8b

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

internal/pkg/pluginmanager/manager.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,25 @@ func DownloadPlugins(conf *configloader.Config) error {
3333
pluginMD5FileName := configloader.GetPluginMD5FileName(&tool)
3434
// plugin does not exist
3535
if _, err := os.Stat(filepath.Join(pluginDir, pluginFileName)); err != nil {
36-
if errors.Is(err, os.ErrNotExist) {
37-
// download .so file
38-
if err := dc.download(pluginDir, pluginFileName, version.Version); err != nil {
39-
return err
40-
}
41-
log.Successf("[%s] download succeeded.", pluginFileName)
42-
} else {
36+
if !errors.Is(err, os.ErrNotExist) {
37+
return err
38+
}
39+
// download .so file
40+
if err := dc.download(pluginDir, pluginFileName, version.Version); err != nil {
4341
return err
4442
}
43+
log.Successf("[%s] download succeeded.", pluginFileName)
4544
}
4645
// .md5 does not exist
4746
if _, err := os.Stat(filepath.Join(pluginDir, pluginMD5FileName)); err != nil {
48-
if errors.Is(err, os.ErrNotExist) {
49-
// download .md5 file
50-
if err := dc.download(pluginDir, pluginMD5FileName, version.Version); err != nil {
51-
return err
52-
}
53-
log.Successf("[%s] download succeeded.", pluginMD5FileName)
54-
} else {
47+
if !errors.Is(err, os.ErrNotExist) {
48+
return err
49+
}
50+
// download .md5 file
51+
if err := dc.download(pluginDir, pluginMD5FileName, version.Version); err != nil {
5552
return err
5653
}
54+
log.Successf("[%s] download succeeded.", pluginMD5FileName)
5755
}
5856
// check if the plugin matches with .md5
5957
isMD5Match, err := md5.FileMatchesMD5(filepath.Join(pluginDir, pluginFileName), filepath.Join(pluginDir, pluginMD5FileName))

0 commit comments

Comments
 (0)