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
+2 -2
View File
@@ -220,12 +220,12 @@ func (c *Changes) GetField(field string) string {
}
// MatchesDependency implements PackageLike interface
func (c *Changes) MatchesDependency(d Dependency) bool {
func (c *Changes) MatchesDependency(_ Dependency) bool {
return false
}
// MatchesArchitecture implements PackageLike interface
func (c *Changes) MatchesArchitecture(arch string) bool {
func (c *Changes) MatchesArchitecture(_ string) bool {
return false
}
+1 -1
View File
@@ -317,7 +317,7 @@ func (collection *PackageCollection) Scan(q PackageQuery) (result *PackageList)
}
// Search is not implemented
func (collection *PackageCollection) Search(dep Dependency, allMatches bool) (searchResults []*Package) {
func (collection *PackageCollection) Search(_ Dependency, _ bool) (searchResults []*Package) {
panic("Not implemented")
}
+5 -5
View File
@@ -138,7 +138,7 @@ func (q *NotQuery) Matches(pkg PackageLike) bool {
}
// Fast is false
func (q *NotQuery) Fast(list PackageCatalog) bool {
func (q *NotQuery) Fast(_ PackageCatalog) bool {
return false
}
@@ -197,7 +197,7 @@ func (q *FieldQuery) Query(list PackageCatalog) (result *PackageList) {
}
// Fast depends on the query
func (q *FieldQuery) Fast(list PackageCatalog) bool {
func (q *FieldQuery) Fast(_ PackageCatalog) bool {
return false
}
@@ -265,7 +265,7 @@ func (q *PkgQuery) Matches(pkg PackageLike) bool {
}
// Fast is always true for package query
func (q *PkgQuery) Fast(list PackageCatalog) bool {
func (q *PkgQuery) Fast(_ PackageCatalog) bool {
return true
}
@@ -280,12 +280,12 @@ func (q *PkgQuery) String() string {
}
// Matches on specific properties
func (q *MatchAllQuery) Matches(pkg PackageLike) bool {
func (q *MatchAllQuery) Matches(_ PackageLike) bool {
return true
}
// Fast is always true for match all query
func (q *MatchAllQuery) Fast(list PackageCatalog) bool {
func (q *MatchAllQuery) Fast(_ PackageCatalog) bool {
return true
}
+1 -1
View File
@@ -428,7 +428,7 @@ ok:
}
// DownloadPackageIndexes downloads & parses package index files
func (repo *RemoteRepo) DownloadPackageIndexes(progress aptly.Progress, d aptly.Downloader, verifier pgp.Verifier, collectionFactory *CollectionFactory,
func (repo *RemoteRepo) DownloadPackageIndexes(progress aptly.Progress, d aptly.Downloader, verifier pgp.Verifier, _ *CollectionFactory,
ignoreMismatch bool) error {
if repo.packageList != nil {
panic("packageList != nil")