Skip to content

Commit 09ef22f

Browse files
committed
fix precommit
Signed-off-by: Huamin Chen <[email protected]>
1 parent 1349768 commit 09ef22f

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/semantic-router/pkg/cache/comprehensive_benchmark_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ func BenchmarkComprehensive(b *testing.B) {
184184
// Open CSV file for results
185185
csvFile, err := os.OpenFile(
186186
"../../benchmark_results/benchmark_data.csv",
187-
os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
187+
os.O_APPEND|os.O_CREATE|os.O_WRONLY,
188+
0o644)
188189
if err != nil {
189190
b.Logf("Warning: Could not open CSV file: %v", err)
190191
} else {

src/semantic-router/pkg/cache/hybrid_cache_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ milvus:
5858
params:
5959
M: 16
6060
efConstruction: 200
61-
`),
62-
0644)
61+
`), 0o644)
6362
if err != nil {
6463
t.Fatalf("Failed to create test config: %v", err)
6564
}
@@ -156,7 +155,7 @@ milvus:
156155
index_type: "HNSW"
157156
metric_type: "IP"
158157
`),
159-
0644)
158+
0o644)
160159
if err != nil {
161160
t.Fatalf("Failed to create test config: %v", err)
162161
}
@@ -220,7 +219,7 @@ milvus:
220219
index_type: "HNSW"
221220
metric_type: "IP"
222221
`),
223-
0644)
222+
0o644)
224223
if err != nil {
225224
t.Fatalf("Failed to create test config: %v", err)
226225
}
@@ -291,7 +290,7 @@ milvus:
291290
index_type: "HNSW"
292291
metric_type: "IP"
293292
`),
294-
0644)
293+
0o644)
295294
if err != nil {
296295
t.Fatalf("Failed to create test config: %v", err)
297296
}
@@ -368,7 +367,7 @@ milvus:
368367
index_type: "HNSW"
369368
metric_type: "IP"
370369
`),
371-
0644)
370+
0o644)
372371
if err != nil {
373372
b.Fatalf("Failed to create test config: %v", err)
374373
}
@@ -412,7 +411,7 @@ milvus:
412411
index_type: "HNSW"
413412
metric_type: "IP"
414413
`),
415-
0644)
414+
0o644)
416415
if err != nil {
417416
b.Fatalf("Failed to create test config: %v", err)
418417
}

src/semantic-router/pkg/cache/large_scale_benchmark_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ func BenchmarkLargeScale(b *testing.B) {
4242
// Open CSV file for results
4343
// Create benchmark_results directory if it doesn't exist
4444
resultsDir := "../../benchmark_results"
45-
if err := os.MkdirAll(resultsDir, 0755); err != nil {
45+
if err := os.MkdirAll(resultsDir, 0o755); err != nil {
4646
b.Logf("Warning: Could not create results directory: %v", err)
4747
}
4848

4949
csvFile, err := os.OpenFile(resultsDir+"/large_scale_benchmark.csv",
50-
os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
50+
os.O_APPEND|os.O_CREATE|os.O_WRONLY,
51+
0o644)
5152
if err != nil {
5253
b.Logf("Warning: Could not open CSV file: %v", err)
5354
} else {
@@ -276,12 +277,12 @@ func BenchmarkScalability(b *testing.B) {
276277

277278
// CSV output
278279
resultsDir := "../../benchmark_results"
279-
if err := os.MkdirAll(resultsDir, 0755); err != nil {
280+
if err := os.MkdirAll(resultsDir, 0o755); err != nil {
280281
b.Logf("Warning: Could not create results directory: %v", err)
281282
}
282283

283284
csvFile, err := os.OpenFile(resultsDir+"/scalability_benchmark.csv",
284-
os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
285+
os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
285286
if err != nil {
286287
b.Logf("Warning: Could not open CSV file: %v", err)
287288
} else {
@@ -446,12 +447,12 @@ func BenchmarkHNSWParameterSweep(b *testing.B) {
446447

447448
// CSV output
448449
resultsDir := "../../benchmark_results"
449-
if err := os.MkdirAll(resultsDir, 0755); err != nil {
450+
if err := os.MkdirAll(resultsDir, 0o755); err != nil {
450451
b.Logf("Warning: Could not create results directory: %v", err)
451452
}
452453

453454
csvFile, err := os.OpenFile(resultsDir+"/hnsw_parameter_sweep.csv",
454-
os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
455+
os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
455456
if err != nil {
456457
b.Logf("Warning: Could not open CSV file: %v", err)
457458
} else {

src/semantic-router/pkg/cache/milvus_cache.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,6 @@ func (c *MilvusCache) GetByID(ctx context.Context, requestID string) ([]byte, er
846846
fmt.Sprintf("request_id == \"%s\"", requestID),
847847
[]string{"response_body"}, // Only fetch document, not embedding!
848848
)
849-
850849
if err != nil {
851850
observability.Debugf("MilvusCache.GetByID: query failed: %v", err)
852851
metrics.RecordCacheOperation("milvus", "get_by_id", "error", time.Since(start).Seconds())

0 commit comments

Comments
 (0)