diff --git a/rhel/ecosystem.go b/rhel/ecosystem.go index 35108ba6b..ed5ac2523 100644 --- a/rhel/ecosystem.go +++ b/rhel/ecosystem.go @@ -8,18 +8,18 @@ import ( ) // NewEcosystem provides the set of scanners and coalescer for the rhel ecosystem. -func NewEcosystem(ctx context.Context) *indexer.Ecosystem { +func NewEcosystem(_ context.Context) *indexer.Ecosystem { return &indexer.Ecosystem{ - PackageScanners: func(ctx context.Context) ([]indexer.PackageScanner, error) { + PackageScanners: func(_ context.Context) ([]indexer.PackageScanner, error) { return []indexer.PackageScanner{new(rpm.Scanner)}, nil }, - DistributionScanners: func(ctx context.Context) ([]indexer.DistributionScanner, error) { + DistributionScanners: func(_ context.Context) ([]indexer.DistributionScanner, error) { return []indexer.DistributionScanner{new(DistributionScanner)}, nil }, - RepositoryScanners: func(ctx context.Context) ([]indexer.RepositoryScanner, error) { + RepositoryScanners: func(_ context.Context) ([]indexer.RepositoryScanner, error) { return []indexer.RepositoryScanner{new(RepositoryScanner)}, nil }, - Coalescer: func(ctx context.Context) (indexer.Coalescer, error) { + Coalescer: func(_ context.Context) (indexer.Coalescer, error) { return new(Coalescer), nil }, } diff --git a/rhel/matcher.go b/rhel/matcher.go index abc016fea..e0bf0aa19 100644 --- a/rhel/matcher.go +++ b/rhel/matcher.go @@ -33,7 +33,7 @@ func (*Matcher) Query() []driver.MatchConstraint { } // Vulnerable implements driver.Matcher. -func (m *Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error) { +func (m *Matcher) Vulnerable(_ context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error) { pkgVer := version.NewVersion(record.Package.Version) var vulnVer version.Version // Assume the vulnerability record we have is for the last known vulnerable diff --git a/rhel/updaterset.go b/rhel/updaterset.go index 4057ad252..bc789cb46 100644 --- a/rhel/updaterset.go +++ b/rhel/updaterset.go @@ -22,7 +22,7 @@ const DefaultManifest = `https://access.redhat.com/security/data/oval/v2/PULP_MA // NewFactory creates a Factory making updaters based on the contents of the // provided pulp manifest. -func NewFactory(ctx context.Context, manifest string) (*Factory, error) { +func NewFactory(_ context.Context, manifest string) (*Factory, error) { var err error var f Factory f.url, err = url.Parse(manifest) diff --git a/rpm/bdb/bdb.go b/rpm/bdb/bdb.go index c5ae1e735..2177cea40 100644 --- a/rpm/bdb/bdb.go +++ b/rpm/bdb/bdb.go @@ -167,7 +167,7 @@ type hashoffpage struct { } // AllHeaders returns ReaderAts for all RPM headers in the PackageDB. -func (db *PackageDB) AllHeaders(ctx context.Context) ([]io.ReaderAt, error) { +func (db *PackageDB) AllHeaders(_ context.Context) ([]io.ReaderAt, error) { var ret []io.ReaderAt pageSz := int64(db.m.PageSize) for n, lim := int64(0), int64(db.m.LastPageNo)+1; n < lim; n++ { diff --git a/rpm/ecosystem.go b/rpm/ecosystem.go index 8500ee2f1..9ee224b5f 100644 --- a/rpm/ecosystem.go +++ b/rpm/ecosystem.go @@ -12,7 +12,7 @@ import ( ) // NewEcosystem provides the set of scanners and coalescers for the rpm ecosystem -func NewEcosystem(ctx context.Context) *indexer.Ecosystem { +func NewEcosystem(_ context.Context) *indexer.Ecosystem { return &indexer.Ecosystem{ PackageScanners: func(ctx context.Context) ([]indexer.PackageScanner, error) { return []indexer.PackageScanner{&Scanner{}}, nil diff --git a/rpm/internal/rpm/header.go b/rpm/internal/rpm/header.go index 035ccc6ff..4d4ffab67 100644 --- a/rpm/internal/rpm/header.go +++ b/rpm/internal/rpm/header.go @@ -78,7 +78,7 @@ func (h *Header) Parse(ctx context.Context, r io.ReaderAt) error { // // NB The TypeChar, TypeInt8, TypeInt16, TypeInt32, TypeInt64, and TypeI18nString // all return slices. -func (h *Header) ReadData(ctx context.Context, e *EntryInfo) (interface{}, error) { +func (h *Header) ReadData(_ context.Context, e *EntryInfo) (interface{}, error) { // TODO(hank) Provide a generic function like `func[T any](*Header, *EntryInfo) T` to do this. switch e.Type { case TypeBin: @@ -180,7 +180,7 @@ func splitCString(data []byte, atEOF bool) (advance int, token []byte, err error return 0, nil, nil } -func (h *Header) loadArenas(ctx context.Context, r io.ReaderAt) error { +func (h *Header) loadArenas(_ context.Context, r io.ReaderAt) error { const ( headerSz = 8 tagsMax = 0x0000ffff @@ -341,7 +341,7 @@ func checkTagType(key Tag, typ Kind) bool { return true } -func (h *Header) loadTag(ctx context.Context, i int) (*EntryInfo, error) { +func (h *Header) loadTag(_ context.Context, i int) (*EntryInfo, error) { e := &h.Infos[i] if e.Tag == Tag(0) { b := make([]byte, entryInfoSize) diff --git a/rpm/native_db.go b/rpm/native_db.go index a9dd664de..aaead125d 100644 --- a/rpm/native_db.go +++ b/rpm/native_db.go @@ -125,6 +125,8 @@ type Info struct { Epoch int } +// Load populates the receiver with information extracted from the provided +// [rpm.Header]. func (i *Info) Load(ctx context.Context, h *rpm.Header) error { for idx := range h.Infos { e := &h.Infos[idx] diff --git a/rpm/ndb/ndb.go b/rpm/ndb/ndb.go index 60604e723..fe5623385 100644 --- a/rpm/ndb/ndb.go +++ b/rpm/ndb/ndb.go @@ -20,7 +20,7 @@ const ( // CheckMagic reports whether the Reader starts with a magic header for // a file format supported by this package. -func CheckMagic(ctx context.Context, r io.Reader) bool { +func CheckMagic(_ context.Context, r io.Reader) bool { const ( xdb = 'R' | 'p'<<8 | 'm'<<16 | 'X'<<24 pkg = 'R' | 'p'<<8 | 'm'<<16 | 'P'<<24 diff --git a/rpm/packagescanner.go b/rpm/packagescanner.go index 58858563a..3159865d6 100644 --- a/rpm/packagescanner.go +++ b/rpm/packagescanner.go @@ -1,3 +1,4 @@ +// Package rpm provides an [indexer.PackageScanner] for the rpm package manager. package rpm import (