mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Enable goconst & interfacer linters
This commit is contained in:
+7
-7
@@ -34,7 +34,7 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
|
||||
srcRepo *deb.LocalRepo
|
||||
)
|
||||
|
||||
if command == "copy" || command == "move" {
|
||||
if command == "copy" || command == "move" { // nolint: goconst
|
||||
srcRepo, err = context.CollectionFactory().LocalRepoCollection().ByName(args[0])
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to %s: %s", command, err)
|
||||
@@ -50,7 +50,7 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
|
||||
}
|
||||
|
||||
srcRefList = srcRepo.RefList()
|
||||
} else if command == "import" {
|
||||
} else if command == "import" { // nolint: goconst
|
||||
var srcRemoteRepo *deb.RemoteRepo
|
||||
|
||||
srcRemoteRepo, err = context.CollectionFactory().RemoteRepoCollection().ByName(args[0])
|
||||
@@ -122,11 +122,11 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
|
||||
|
||||
var verb string
|
||||
|
||||
if command == "move" {
|
||||
if command == "move" { // nolint: goconst
|
||||
verb = "moved"
|
||||
} else if command == "copy" {
|
||||
} else if command == "copy" { // nolint: goconst
|
||||
verb = "copied"
|
||||
} else if command == "import" {
|
||||
} else if command == "import" { // nolint: goconst
|
||||
verb = "imported"
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if command == "move" {
|
||||
if command == "move" { // nolint: goconst
|
||||
srcList.Remove(p)
|
||||
}
|
||||
context.Progress().ColoredPrintf("@g[o]@| %s %s", p, verb)
|
||||
@@ -156,7 +156,7 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
|
||||
return fmt.Errorf("unable to save: %s", err)
|
||||
}
|
||||
|
||||
if command == "move" {
|
||||
if command == "move" { // nolint: goconst
|
||||
srcRepo.UpdateRefList(deb.NewPackageRefListFromPackageList(srcList))
|
||||
|
||||
err = context.CollectionFactory().LocalRepoCollection().Update(srcRepo)
|
||||
|
||||
Reference in New Issue
Block a user