refactor: reduce use of pointers in particular, Source can no longer be nil. Instantiate a Source with an Importer of All instead
1 file changed, 5 insertions(+), 3 deletions(-)
changed files
M internal/server/global.go → internal/server/global.go
@@ -30,7 +30,7 @@ errorHandler func(w http.ResponseWriter, r *http.Request, message string, statusCode int) } -func (g *GlobalHandler) NewSourceHandler(source *config.Source) *SourceHandler { +func (g *GlobalHandler) NewSourceHandler(source config.Source) *SourceHandler { h := &SourceHandler{ global: g, source: source,@@ -44,7 +44,7 @@ return h } -func (g *GlobalHandler) Search(source *config.Source, w http.ResponseWriter, r *http.Request) { +func (g *GlobalHandler) Search(source config.Source, w http.ResponseWriter, r *http.Request) { facets := r.URL.Query() facets.Del("query") facets.Del("page")@@ -148,7 +148,9 @@ } } func (g *GlobalHandler) CombinedSearch(w http.ResponseWriter, r *http.Request) { - g.Search(nil, w, r) + g.Search(config.Source{ + Importer: config.All, + }, w, r) } func (g *GlobalHandler) RootOpenSearch(w http.ResponseWriter, _ *http.Request) {