diff --git a/private/compile/compile.go b/private/compile/compile.go index 8d0da4ce4..303755ab0 100644 --- a/private/compile/compile.go +++ b/private/compile/compile.go @@ -18,6 +18,8 @@ import ( "go.uber.org/zap" ) +type Index = index.Index + type Artefact struct { Error error PolicySet *runtimev1.RunnablePolicySet @@ -39,7 +41,7 @@ func (e *Errors) Error() string { } } -func Files(ctx context.Context, fsys fs.FS) (index.Index, <-chan Artefact, error) { +func Files(ctx context.Context, fsys fs.FS) (Index, <-chan Artefact, error) { idx, err := index.Build(ctx, fsys) if err != nil { idxErrs := new(index.BuildError) diff --git a/private/verify/verify.go b/private/verify/verify.go index 55bac1db0..bc4d676d8 100644 --- a/private/verify/verify.go +++ b/private/verify/verify.go @@ -26,7 +26,7 @@ import ( ) // Files runs tests using the policy files in the given file system. -func Files(ctx context.Context, fsys fs.FS, idx index.Index) (*policyv1.TestResults, error) { +func Files(ctx context.Context, fsys fs.FS, idx compile.Index) (*policyv1.TestResults, error) { if idx == nil { var err error idx, err = index.Build(ctx, fsys, index.WithBuildFailureLogLevel(zap.DebugLevel))