diff --git a/deb/remote.go b/deb/remote.go index f49c3d57..72165baf 100644 --- a/deb/remote.go +++ b/deb/remote.go @@ -540,12 +540,10 @@ func (repo *RemoteRepo) DownloadPackageIndexes(progress aptly.Progress, d aptly. } } err = repo.packageList.Add(p) - if err != nil { - if _, ok := err.(*PackageConflictError); ok { - progress.ColoredPrintf("@y[!]@| @!skipping package %s: duplicate in packages index@|", p) - } else { - return err - } + if _, ok := err.(*PackageConflictError); ok { + progress.ColoredPrintf("@y[!]@| @!skipping package %s: duplicate in packages index@|", p) + } else if err != nil { + return err } } diff --git a/deb/version_test.go b/deb/version_test.go index 5558afc1..32ebbb85 100644 --- a/deb/version_test.go +++ b/deb/version_test.go @@ -5,7 +5,6 @@ import ( ) type VersionSuite struct { - stanza Stanza } var _ = Suite(&VersionSuite{}) diff --git a/http/download.go b/http/download.go index 73fb189b..cdc8ff3d 100644 --- a/http/download.go +++ b/http/download.go @@ -81,7 +81,7 @@ func (downloader *downloaderImpl) GetLength(ctx context.Context, url string) (in } if resp.ContentLength < 0 { - return -1, fmt.Errorf("Could not determine length of %s", url) + return -1, fmt.Errorf("could not determine length of %s", url) } return resp.ContentLength, nil @@ -94,12 +94,12 @@ func (downloader *downloaderImpl) Download(ctx context.Context, url string, dest func retryableError(err error) bool { switch err.(type) { - case net.Error: - return true case *net.OpError: return true case syscall.Errno: return true + case net.Error: + return true } return false } diff --git a/linter.json b/linter.json index 2f221d88..50fcbd87 100644 --- a/linter.json +++ b/linter.json @@ -7,7 +7,6 @@ "deadcode", "goimports", "misspell", - "gosimple", "ineffassign", "staticcheck", "varcheck", diff --git a/pgp/gnupg_test.go b/pgp/gnupg_test.go index bf830560..9ee8dfa4 100644 --- a/pgp/gnupg_test.go +++ b/pgp/gnupg_test.go @@ -10,8 +10,7 @@ import ( ) type GnupgSuite struct { - verifier Verifier - bins string + bins string } var _ = Suite(&GnupgSuite{}) diff --git a/query/lex.go b/query/lex.go index dbf59542..1aeb349f 100644 --- a/query/lex.go +++ b/query/lex.go @@ -119,14 +119,6 @@ func (l *lexer) backup() { l.pos -= l.width } -// peek returns but does not consume -// the next rune in the input. -func (l *lexer) peek() rune { - r := l.next() - l.backup() - return r -} - func (l *lexer) Current() item { if l.last.typ == 0 { l.last = <-l.items diff --git a/s3/server_test.go b/s3/server_test.go index 63eb219c..573097ab 100644 --- a/s3/server_test.go +++ b/s3/server_test.go @@ -73,7 +73,6 @@ type Server struct { type bucket struct { name string acl string - ctime time.Time objects map[string]*object } diff --git a/utils/utils.go b/utils/utils.go index 4de5f218..598dc7c8 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -13,7 +13,7 @@ func DirIsAccessible(filename string) error { _, err := os.Stat(filename) if err != nil { if !os.IsNotExist(err) { - return fmt.Errorf("Something went wrong, %v", err) + return fmt.Errorf("error checking directory '%s': %s", filename, err) } } else { if unix.Access(filename, unix.W_OK) != nil {