Skip to content

Commit

Permalink
use built in interface
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinAbro321 committed Jun 26, 2024
1 parent 00d435b commit c467155
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/pkg/packager/lint/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package lint
import (
"context"
"fmt"
"io/fs"
"regexp"
"strings"

Expand All @@ -22,13 +23,8 @@ import (
"github.com/xeipuuv/gojsonschema"
)

// FileLoader is an interface for reading files, it decouples the lint package from the go embed package which enables testing
type FileLoader interface {
ReadFile(path string) ([]byte, error)
}

// ZarfSchema is exported so main.go can embed the schema file
var ZarfSchema FileLoader
var ZarfSchema fs.ReadFileFS

// Validate validates a zarf file
func Validate(ctx context.Context, createOpts types.ZarfCreateOptions) ([]types.PackageFinding, error) {
Expand Down

0 comments on commit c467155

Please sign in to comment.