Skip to content

Commit

Permalink
feat(specs): Expose specs as a pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
simar7 committed Jun 19, 2024
1 parent e61345e commit f70b803
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/spec/spec.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package spec

import (
"github.com/aquasecurity/trivy-checks/specs"
"github.com/aquasecurity/trivy-checks/pkg/specs"
)

// Loader access compliance specs
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions specs/loader.go → pkg/specs/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ const ComplianceFolder = "compliance"

var (
//go:embed compliance
complainceFS embed.FS
complianceFS embed.FS
)

var complianceSpecMap map[string]string

// Load compliance specs
func init() {
dir, _ := complainceFS.ReadDir(ComplianceFolder)
dir, _ := complianceFS.ReadDir(ComplianceFolder)
complianceSpecMap = make(map[string]string, 0)
for _, r := range dir {
if !strings.Contains(r.Name(), ".yaml") {
continue
}
file, err := complainceFS.Open(fmt.Sprintf("%s/%s", ComplianceFolder, r.Name()))
file, err := complianceFS.Open(fmt.Sprintf("%s/%s", ComplianceFolder, r.Name()))
if err != nil {
panic(err)
}
Expand Down
File renamed without changes.

0 comments on commit f70b803

Please sign in to comment.