Merge pull request #11613 from knweiss/gosimple

Code simplification (gosimple)
This commit is contained in:
Carl Bergquist
2018-04-17 22:40:40 +02:00
committed by GitHub
45 changed files with 89 additions and 174 deletions
@@ -33,7 +33,7 @@ func validateInput(c CommandLine, pluginFolder string) error {
fileInfo, err := os.Stat(pluginsDir)
if err != nil {
if err = os.MkdirAll(pluginsDir, os.ModePerm); err != nil {
return errors.New(fmt.Sprintf("pluginsDir (%s) is not a writable directory", pluginsDir))
return fmt.Errorf("pluginsDir (%s) is not a writable directory", pluginsDir)
}
return nil
}
+1 -1
View File
@@ -24,7 +24,7 @@ var validateLsCommand = func(pluginDir string) error {
return fmt.Errorf("error: %s", err)
}
if pluginDirInfo.IsDir() == false {
if !pluginDirInfo.IsDir() {
return errors.New("plugin path is not a directory")
}
@@ -53,8 +53,7 @@ func upgradeAllCommand(c CommandLine) error {
for _, p := range pluginsToUpgrade {
logger.Infof("Updating %v \n", p.Id)
var err error
err = s.RemoveInstalledPlugin(pluginsDir, p.Id)
err := s.RemoveInstalledPlugin(pluginsDir, p.Id)
if err != nil {
return err
}