about summary refs log tree commit diff stats
path: root/internal/importer/importer.go
diff options
context:
space:
mode:
authorAlan Pearce2024-05-11 14:34:15 +0200
committerAlan Pearce2024-05-11 14:37:30 +0200
commit1aa991ae1f1a426424549c92060b204114c8b3c2 (patch)
tree59dc9e67d6b0c5604d9a70f52260ae7d85411e6f /internal/importer/importer.go
parent48423548f4718886d32a87ddd65d5ee2620fd8c8 (diff)
downloadsearchix-1aa991ae1f1a426424549c92060b204114c8b3c2.tar.lz
searchix-1aa991ae1f1a426424549c92060b204114c8b3c2.tar.zst
searchix-1aa991ae1f1a426424549c92060b204114c8b3c2.zip
refactor: deduce index path automatically from config.DataPath
Diffstat (limited to 'internal/importer/importer.go')
-rw-r--r--internal/importer/importer.go23
1 files changed, 9 insertions, 14 deletions
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(