Enable goconst & interfacer linters

This commit is contained in:
Andrey Smirnov
2017-05-16 00:26:41 +03:00
parent e396a2e6c3
commit 470165a419
26 changed files with 110 additions and 82 deletions
+7 -7
View File
@@ -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)