Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scanner/base) export libFile struct #1365

Merged
merged 1 commit into from
Jan 18, 2022
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
8 changes: 4 additions & 4 deletions scanner/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ func (l *base) parseSystemctlStatus(stdout string) string {
return ss[1]
}

type libFile struct {
type LibFile struct {
contents []byte
filemode os.FileMode
}
Expand All @@ -579,7 +579,7 @@ func (l *base) scanLibraries() (err error) {

l.log.Info("Scanning Lockfile...")

libFilemap := map[string]libFile{}
libFilemap := map[string]LibFile{}
detectFiles := l.ServerInfo.Lockfiles

// auto detect lockfile
Expand Down Expand Up @@ -613,7 +613,7 @@ func (l *base) scanLibraries() (err error) {
continue
}

var f libFile
var f LibFile
switch l.Distro.Family {
case constant.ServerTypePseudo:
fileinfo, err := os.Stat(path)
Expand Down Expand Up @@ -657,7 +657,7 @@ func (l *base) scanLibraries() (err error) {
}

// AnalyzeLibraries : detects libs defined in lockfile
func AnalyzeLibraries(ctx context.Context, libFilemap map[string]libFile, isOffline bool) (libraryScanners []models.LibraryScanner, err error) {
func AnalyzeLibraries(ctx context.Context, libFilemap map[string]LibFile, isOffline bool) (libraryScanners []models.LibraryScanner, err error) {
disabledAnalyzers := []analyzer.Type{
analyzer.TypeAlpine,
analyzer.TypeAlma,
Expand Down