Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions rhel/ecosystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
}
Expand Down
2 changes: 1 addition & 1 deletion rhel/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rhel/updaterset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion rpm/bdb/bdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand Down
2 changes: 1 addition & 1 deletion rpm/ecosystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rpm/internal/rpm/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions rpm/native_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion rpm/ndb/ndb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions rpm/packagescanner.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package rpm provides an [indexer.PackageScanner] for the rpm package manager.
package rpm

import (
Expand Down