From 1aa991ae1f1a426424549c92060b204114c8b3c2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 11 May 2024 14:34:15 +0200 Subject: refactor: deduce index path automatically from config.DataPath --- internal/importer/importer.go | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'internal/importer/importer.go') 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( -- cgit 1.4.1