about summary refs log tree commit diff stats
path: root/internal/importer
diff options
context:
space:
mode:
Diffstat (limited to 'internal/importer')
-rw-r--r--internal/importer/channel.go8
-rw-r--r--internal/importer/importer.go23
-rw-r--r--internal/importer/nixpkgs-channel.go14
3 files changed, 18 insertions, 27 deletions
diff --git a/internal/importer/channel.go b/internal/importer/channel.go
index 3c199cc..97f0a27 100644
--- a/internal/importer/channel.go
+++ b/internal/importer/channel.go
@@ -20,7 +20,6 @@ type ChannelImporter struct {
 	Source     *Source
 	SourceFile string
 	Logger     *slog.Logger
-	indexPath  string
 }
 
 func (i *ChannelImporter) FetchIfNeeded(parent context.Context) (bool, error) {
@@ -86,9 +85,8 @@ func (i *ChannelImporter) Import(parent context.Context, indexer *search.WriteIn
 	i.Logger.Debug("preparing import run", "revision", i.Source.Repo.Revision, "filename", filename)
 
 	return processOptions(parent, indexer, &importConfig{
-		IndexPath: i.indexPath,
-		Source:    i.Source,
-		Filename:  filename,
-		Logger:    i.Logger,
+		Source:   i.Source,
+		Filename: filename,
+		Logger:   i.Logger,
 	})
 }
diff --git a/internal/importer/importer.go b/internal/importer/importer.go
index 1338615..8a18c60 100644
--- a/internal/importer/importer.go
+++ b/internal/importer/importer.go
@@ -32,34 +32,29 @@ func NewNixpkgsChannelImporter(
 	dataPath string,
 	logger *slog.Logger,
 ) *NixpkgsChannelImporter {
-	indexPath := dataPath
 	fullpath := path.Join(dataPath, source.Channel)
 
 	return &NixpkgsChannelImporter{
-		DataPath:  fullpath,
-		Source:    source,
-		Logger:    logger,
-		indexPath: indexPath,
+		DataPath: fullpath,
+		Source:   source,
+		Logger:   logger,
 	}
 }
 
 func NewChannelImporter(source *Source, dataPath string, logger *slog.Logger) *ChannelImporter {
-	indexPath := dataPath
 	fullpath := path.Join(dataPath, source.Channel)
 
 	return &ChannelImporter{
-		DataPath:  fullpath,
-		Source:    source,
-		Logger:    logger,
-		indexPath: indexPath,
+		DataPath: fullpath,
+		Source:   source,
+		Logger:   logger,
 	}
 }
 
 type importConfig struct {
-	IndexPath string
-	Filename  string
-	Source    *Source
-	Logger    *slog.Logger
+	Filename string
+	Source   *Source
+	Logger   *slog.Logger
 }
 
 func processOptions(
diff --git a/internal/importer/nixpkgs-channel.go b/internal/importer/nixpkgs-channel.go
index b78844b..2ee6027 100644
--- a/internal/importer/nixpkgs-channel.go
+++ b/internal/importer/nixpkgs-channel.go
@@ -14,10 +14,9 @@ import (
 )
 
 type NixpkgsChannelImporter struct {
-	DataPath  string
-	Source    *Source
-	Logger    *slog.Logger
-	indexPath string
+	DataPath string
+	Source   *Source
+	Logger   *slog.Logger
 }
 
 func makeChannelURL(channel string, subPath string) (string, error) {
@@ -77,9 +76,8 @@ func (i *NixpkgsChannelImporter) Import(
 	i.Logger.Debug("preparing import run", "revision", i.Source.Repo.Revision, "filename", filename)
 
 	return processOptions(parent, indexer, &importConfig{
-		IndexPath: i.indexPath,
-		Source:    i.Source,
-		Filename:  filename,
-		Logger:    i.Logger,
+		Source:   i.Source,
+		Filename: filename,
+		Logger:   i.Logger,
 	})
 }