about summary refs log tree commit diff stats
path: root/internal/importer/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/importer/options.go')
-rw-r--r--internal/importer/options.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/internal/importer/options.go b/internal/importer/options.go
index ec2c20f..0aadc50 100644
--- a/internal/importer/options.go
+++ b/internal/importer/options.go
@@ -2,8 +2,8 @@ package importer
 
 import (
 	"context"
+	"io"
 	"log/slog"
-	"os"
 	"reflect"
 	"searchix/internal/config"
 	"searchix/internal/nix"
@@ -58,15 +58,11 @@ type OptionIngester struct {
 	dec     *jstream.Decoder
 	ms      *mapstructure.Decoder
 	optJSON nixOptionJSON
-	infile  *os.File
+	infile  io.ReadCloser
 	source  *config.Source
 }
 
-func NewOptionProcessor(inpath string, source *config.Source) (*OptionIngester, error) {
-	infile, err := os.Open(inpath)
-	if err != nil {
-		return nil, errors.WithMessagef(err, "failed to open input file %s", inpath)
-	}
+func NewOptionProcessor(infile io.ReadCloser, source *config.Source) (*OptionIngester, error) {
 	i := OptionIngester{
 		dec:     jstream.NewDecoder(infile, 1).EmitKV(),
 		optJSON: nixOptionJSON{},