docs(comments): 注释中文化 · internal/runtime/memory(31 文件,纯替换)
- 只翻注释/文档字符串:820 增 / 820 删 严格 1:1;剥掉整行注释与行尾注释尾巴后, 逐文件与 HEAD 比对「代码部分差异 = 0」;裁决/design 编号计数逐项与 HEAD 一致 - 保留可执行 SQL 样例、SQLite 报错原文、pgvector/HNSW/ANN/BLOB 等技术词原文 - 复核:go build 绿 + memory/projectindex/vector 三包测试绿;gofmt 仅剩 2 个既有未格式化文件(改动前即如此,未顺手修)
This commit is contained in:
1 parent
eb1828ee7a
commit
61cf80d5ee
31 files changed
+820
-820
No files matched your search
@@ -16,7 +16,7 @@ func TestNewPG_InvalidURL_异常(t *testing.T) {
|
||||
|
||||
func TestNewPG_InvalidDim_异常(t *testing.T) {
|
||||
t.Parallel()
|
||||
// dim is validated before any connection is opened, so no network I/O here.
|
||||
// dim 在任何连接打开前就校验,因此这里没有网络 I/O。
|
||||
if _, err := NewPG(context.Background(), "postgres://host/db", 0, testLogger()); !errors.Is(err, ErrInvalidDim) {
|
||||
t.Fatalf("NewPG(dim 0) err = %v, want ErrInvalidDim", err)
|
||||
}
|
||||
@@ -44,11 +44,11 @@ func TestPGVectorLiteral(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestPG_RequiresEnv runs a real PostgreSQL+pgvector round trip when DB_PG_URL
|
||||
// is set, and skips otherwise. There is no PG server in this environment by
|
||||
// default, so the pgvector-backed Add/Search path is validated end-to-end only
|
||||
// when the operator supplies a live database with the pgvector extension. The
|
||||
// SQLite path (the default) is fully covered by the sqlite_test.go suite.
|
||||
// TestPG_RequiresEnv 在设置了 DB_PG_URL 时跑一次真实的
|
||||
// PostgreSQL+pgvector 往返,否则跳过。本环境默认没有 PG
|
||||
// 服务,因此由 pgvector 支撑的 Add/Search 路径只有在
|
||||
// 操作者提供带 pgvector 扩展的活数据库时才端到端验证。
|
||||
// SQLite 路径(默认)由 sqlite_test.go 套件完整覆盖。
|
||||
func TestPG_RequiresEnv(t *testing.T) {
|
||||
url := os.Getenv("DB_PG_URL")
|
||||
if url == "" {
|
||||
@@ -81,7 +81,7 @@ func TestPG_RequiresEnv(t *testing.T) {
|
||||
t.Fatalf("pg a score = %v, want ~1.0", hits[0].Score)
|
||||
}
|
||||
|
||||
// The embedder is wired, so Index.Embed is usable.
|
||||
// embedder 已接入,因此 Index.Embed 可用。
|
||||
vs, err := idx.Embed(ctx, []string{"hello"})
|
||||
if err != nil {
|
||||
t.Fatalf("Embed: %v", err)
|
||||
|
||||
Reference in new issue
Block a user