Skip to content
Merged
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
9 changes: 6 additions & 3 deletions rhel/repo2cpe/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ func NewLocalUpdaterJob(url string, client *http.Client) *LocalUpdaterJob {
if client == nil {
client = http.DefaultClient
}
return &LocalUpdaterJob{
lu := &LocalUpdaterJob{
URL: url,
Client: client,
}
lu.mapping.Store((*MappingFile)(nil))
return lu
}

// Get translates repositories into CPEs using a mapping file.
Expand All @@ -50,9 +52,10 @@ func (updater *LocalUpdaterJob) Get(ctx context.Context, repositories []string)
}

cpes := []string{}
var mapping *MappingFile = updater.mapping.Load().(*MappingFile)
// interface conversion guaranteed to pass, see
// constructor.
mapping := updater.mapping.Load().(*MappingFile)
if mapping == nil {
// mapping not set yet. not an error
return cpes, nil
}

Expand Down