Fix: Implement golangci-lint suggestions

This commit is contained in:
Mauro Regli
2023-09-13 11:44:58 +02:00
committed by Mauro
parent f4a152ab22
commit ae61706a34
27 changed files with 51 additions and 62 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"github.com/smira/commander"
)
func aptlyConfigShow(cmd *commander.Command, args []string) error {
func aptlyConfigShow(_ *commander.Command, _ []string) error {
config := context.Config()
prettyJSON, err := json.MarshalIndent(config, "", " ")
+2 -2
View File
@@ -24,7 +24,7 @@ func aptlyMirrorList(cmd *commander.Command, args []string) error {
return aptlyMirrorListTxt(cmd, args)
}
func aptlyMirrorListTxt(cmd *commander.Command, args []string) error {
func aptlyMirrorListTxt(cmd *commander.Command, _ []string) error {
var err error
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
@@ -65,7 +65,7 @@ func aptlyMirrorListTxt(cmd *commander.Command, args []string) error {
return err
}
func aptlyMirrorListJSON(cmd *commander.Command, args []string) error {
func aptlyMirrorListJSON(_ *commander.Command, _ []string) error {
var err error
repos := make([]*deb.RemoteRepo, context.NewCollectionFactory().RemoteRepoCollection().Len())
+2 -2
View File
@@ -27,7 +27,7 @@ func aptlyMirrorShow(cmd *commander.Command, args []string) error {
return aptlyMirrorShowTxt(cmd, args)
}
func aptlyMirrorShowTxt(cmd *commander.Command, args []string) error {
func aptlyMirrorShowTxt(_ *commander.Command, args []string) error {
var err error
name := args[0]
@@ -93,7 +93,7 @@ func aptlyMirrorShowTxt(cmd *commander.Command, args []string) error {
return err
}
func aptlyMirrorShowJSON(cmd *commander.Command, args []string) error {
func aptlyMirrorShowJSON(_ *commander.Command, args []string) error {
var err error
name := args[0]
+2 -2
View File
@@ -25,7 +25,7 @@ func aptlyPublishList(cmd *commander.Command, args []string) error {
return aptlyPublishListTxt(cmd, args)
}
func aptlyPublishListTxt(cmd *commander.Command, args []string) error {
func aptlyPublishListTxt(cmd *commander.Command, _ []string) error {
var err error
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
@@ -77,7 +77,7 @@ func aptlyPublishListTxt(cmd *commander.Command, args []string) error {
return err
}
func aptlyPublishListJSON(cmd *commander.Command, args []string) error {
func aptlyPublishListJSON(_ *commander.Command, _ []string) error {
var err error
repos := make([]*deb.PublishedRepo, 0, context.NewCollectionFactory().PublishedRepoCollection().Len())
+2 -2
View File
@@ -24,7 +24,7 @@ func aptlyPublishShow(cmd *commander.Command, args []string) error {
return aptlyPublishShowTxt(cmd, args)
}
func aptlyPublishShowTxt(cmd *commander.Command, args []string) error {
func aptlyPublishShowTxt(_ *commander.Command, args []string) error {
var err error
distribution := args[0]
@@ -76,7 +76,7 @@ func aptlyPublishShowTxt(cmd *commander.Command, args []string) error {
return err
}
func aptlyPublishShowJSON(cmd *commander.Command, args []string) error {
func aptlyPublishShowJSON(_ *commander.Command, args []string) error {
var err error
distribution := args[0]
+2 -2
View File
@@ -24,7 +24,7 @@ func aptlyRepoList(cmd *commander.Command, args []string) error {
return aptlyRepoListTxt(cmd, args)
}
func aptlyRepoListTxt(cmd *commander.Command, args []string) error {
func aptlyRepoListTxt(cmd *commander.Command, _ []string) error {
var err error
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
@@ -71,7 +71,7 @@ func aptlyRepoListTxt(cmd *commander.Command, args []string) error {
return err
}
func aptlyRepoListJSON(cmd *commander.Command, args []string) error {
func aptlyRepoListJSON(_ *commander.Command, _ []string) error {
var err error
repos := make([]*deb.LocalRepo, context.NewCollectionFactory().LocalRepoCollection().Len())
+2 -2
View File
@@ -25,7 +25,7 @@ func aptlyRepoShow(cmd *commander.Command, args []string) error {
return aptlyRepoShowTxt(cmd, args)
}
func aptlyRepoShowTxt(cmd *commander.Command, args []string) error {
func aptlyRepoShowTxt(_ *commander.Command, args []string) error {
var err error
name := args[0]
@@ -58,7 +58,7 @@ func aptlyRepoShowTxt(cmd *commander.Command, args []string) error {
return err
}
func aptlyRepoShowJSON(cmd *commander.Command, args []string) error {
func aptlyRepoShowJSON(_ *commander.Command, args []string) error {
var err error
name := args[0]
+2 -2
View File
@@ -23,7 +23,7 @@ func aptlySnapshotList(cmd *commander.Command, args []string) error {
return aptlySnapshotListTxt(cmd, args)
}
func aptlySnapshotListTxt(cmd *commander.Command, args []string) error {
func aptlySnapshotListTxt(cmd *commander.Command, _ []string) error {
var err error
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
@@ -59,7 +59,7 @@ func aptlySnapshotListTxt(cmd *commander.Command, args []string) error {
return err
}
func aptlySnapshotListJSON(cmd *commander.Command, args []string) error {
func aptlySnapshotListJSON(cmd *commander.Command, _ []string) error {
var err error
sortMethodString := cmd.Flag.Lookup("sort").Value.Get().(string)
+2 -2
View File
@@ -25,7 +25,7 @@ func aptlySnapshotShow(cmd *commander.Command, args []string) error {
return aptlySnapshotShowTxt(cmd, args)
}
func aptlySnapshotShowTxt(cmd *commander.Command, args []string) error {
func aptlySnapshotShowTxt(_ *commander.Command, args []string) error {
var err error
name := args[0]
collectionFactory := context.NewCollectionFactory()
@@ -85,7 +85,7 @@ func aptlySnapshotShowTxt(cmd *commander.Command, args []string) error {
return err
}
func aptlySnapshotShowJSON(cmd *commander.Command, args []string) error {
func aptlySnapshotShowJSON(_ *commander.Command, args []string) error {
var err error
name := args[0]
+3 -4
View File
@@ -62,11 +62,10 @@ func aptlyTaskRun(cmd *commander.Command, args []string) error {
text, _ = reader.ReadString('\n')
if text == "\n" {
break
} else {
text = strings.TrimSpace(text) + ","
parsedArgs, _ := shellwords.Parse(text)
cmdArgs = append(cmdArgs, parsedArgs...)
}
text = strings.TrimSpace(text) + ","
parsedArgs, _ := shellwords.Parse(text)
cmdArgs = append(cmdArgs, parsedArgs...)
}
if len(cmdArgs) == 0 {