From 4cfe2fe37f3b048bc7fad2e197dd0d49ea4307ce Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Fri, 13 Mar 2026 11:19:49 +0300 Subject: Fix: linter complaints --- rag/rag.go | 4 ---- rag/rag_integration_test.go | 1 - rag/rag_real_test.go | 2 -- rag/rag_test.go | 4 ---- storage/vector.go | 1 - 5 files changed, 12 deletions(-) diff --git a/rag/rag.go b/rag/rag.go index 3a771d4..18609ef 100644 --- a/rag/rag.go +++ b/rag/rag.go @@ -47,7 +47,6 @@ func isStopWord(word string) bool { func detectPhrases(query string) []string { words := strings.Fields(strings.ToLower(query)) var phrases []string - for i := 0; i < len(words)-1; i++ { word1 := strings.Trim(words[i], ".,!?;:'\"()[]{}") word2 := strings.Trim(words[i+1], ".,!?;:'\"()[]{}") @@ -70,7 +69,6 @@ func detectPhrases(query string) []string { } } } - return phrases } @@ -122,7 +120,6 @@ func areSlugsAdjacent(slug1, slug2 string) bool { if prefix1 != prefix2 { return false } - batch1, chunk1, ok1 := parseSlugIndices(slug1) batch2, chunk2, ok2 := parseSlugIndices(slug2) if !ok1 || !ok2 { @@ -843,7 +840,6 @@ func (r *RAG) GenerateQueryVariations(query string) []string { } } } - return variations } diff --git a/rag/rag_integration_test.go b/rag/rag_integration_test.go index f3405eb..6cd56c6 100644 --- a/rag/rag_integration_test.go +++ b/rag/rag_integration_test.go @@ -297,7 +297,6 @@ relative term as it was still a few kilometers away. The clan house was made of brick and conformed to an older style of architecture. Nearly everyone knew about this mansion and its clock tower. It stood tall over the neighboring mansions and rumor had it that you could see the whole capital from the top. It spoke to this clan’s renown and history that they were able to get away with building something that dwarfed the mansions of the nobility.` - chunks := []*models.VectorRow{ { Slug: "kjv_bible.epub_1786_0", diff --git a/rag/rag_real_test.go b/rag/rag_real_test.go index 87f6906..a4a2508 100644 --- a/rag/rag_real_test.go +++ b/rag/rag_real_test.go @@ -41,7 +41,6 @@ func TestRealBiblicalQuery(t *testing.T) { t.Fatalf("failed to create RAG instance: %v", err) } t.Cleanup(func() { rag.Destroy() }) - query := "bald prophet and two she bears" results, err := rag.Search(query, 30) if err != nil { @@ -95,7 +94,6 @@ func TestRealQueryVariations(t *testing.T) { t.Fatalf("failed to create RAG instance: %v", err) } t.Cleanup(func() { rag.Destroy() }) - tests := []struct { name string query string diff --git a/rag/rag_test.go b/rag/rag_test.go index 4944007..a2204ee 100644 --- a/rag/rag_test.go +++ b/rag/rag_test.go @@ -30,7 +30,6 @@ func TestDetectPhrases(t *testing.T) { expect: []string{}, }, } - for _, tt := range tests { got := detectPhrases(tt.query) if len(got) != len(tt.expect) { @@ -73,7 +72,6 @@ func TestCountPhraseMatches(t *testing.T) { expect: 2, // "she bears" and "bald prophet" }, } - for _, tt := range tests { got := countPhraseMatches(tt.text, tt.query) if got != tt.expect { @@ -119,7 +117,6 @@ func TestAreSlugsAdjacent(t *testing.T) { expect: true, // sequential batches with same chunk index are adjacent }, } - for _, tt := range tests { got := areSlugsAdjacent(tt.slug1, tt.slug2) if got != tt.expect { @@ -141,7 +138,6 @@ func TestParseSlugIndices(t *testing.T) { {"file_abc_def", 0, 0, false}, {"file_123_456_extra", 456, 0, false}, // regex matches last two numbers } - for _, tt := range tests { batch, chunk, ok := parseSlugIndices(tt.slug) if ok != tt.wantOk { diff --git a/storage/vector.go b/storage/vector.go index e8ecb52..fed78a9 100644 --- a/storage/vector.go +++ b/storage/vector.go @@ -162,7 +162,6 @@ func (p ProviderSQL) ListFiles() ([]string, error) { return nil, err } defer rows.Close() - var allFiles []string for rows.Next() { var filename string -- cgit v1.2.3