重构:简化 RecordIndex 结构体
删除独立的 IndexHeader 结构体,将 magic 和 version 字段直接放入 RecordIndex,减少不必要的嵌套层级。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -272,12 +272,12 @@ func TestIndexHeader(t *testing.T) {
|
||||
writer.Close()
|
||||
|
||||
// 验证魔数和版本
|
||||
if index.header.Magic != IndexMagic {
|
||||
t.Errorf("Magic 不正确: got 0x%X, want 0x%X", index.header.Magic, IndexMagic)
|
||||
if index.magic != IndexMagic {
|
||||
t.Errorf("Magic 不正确: got 0x%X, want 0x%X", index.magic, IndexMagic)
|
||||
}
|
||||
|
||||
if index.header.Version != IndexVersion {
|
||||
t.Errorf("Version 不正确: got %d, want %d", index.header.Version, IndexVersion)
|
||||
if index.version != IndexVersion {
|
||||
t.Errorf("Version 不正确: got %d, want %d", index.version, IndexVersion)
|
||||
}
|
||||
|
||||
// 验证记录总数(从内存索引计算)
|
||||
|
||||
Reference in New Issue
Block a user