mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-07 05:42:42 +00:00
Fix: Implement golangci-lint suggestions
This commit is contained in:
+1
-1
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user