Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
feat: use proper util package
Browse files Browse the repository at this point in the history
  • Loading branch information
ramizpolic committed Feb 9, 2024
1 parent e902468 commit acd7388
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 3 additions & 3 deletions cli/analyzer/windows/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (
"strconv"
"strings"

"github.com/openclarity/vmclarity/core/to"

cdx "github.com/CycloneDX/cyclonedx-go"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"

"github.com/openclarity/vmclarity/cli/utils"

"www.velocidex.com/golang/regparser"
)

Expand Down Expand Up @@ -177,7 +177,7 @@ func (r *Registry) GetUpdates() ([]string, error) {
}
}

return utils.StringKeyMapToArray(updates), nil
return to.Keys(updates), nil
}

// GetUsersApps returns installed apps from the registry for all users. This
Expand Down
8 changes: 0 additions & 8 deletions cli/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ func RunCommandAndParseOutputLineByLine(cmd *exec.Cmd, pfn, ecFn processFn) erro
return nil
}

func StringKeyMapToArray[T any](m map[string]T) []T {
ret := make([]T, 0, len(m))
for _, t := range m {
ret = append(ret, t)
}
return ret
}

func GetVulnerabilityTotalsPerSeverity(vulnerabilities *[]apitypes.Vulnerability) *apitypes.VulnerabilityScanSummary {
ret := &apitypes.VulnerabilityScanSummary{
TotalCriticalVulnerabilities: to.Ptr(0),
Expand Down

0 comments on commit acd7388

Please sign in to comment.