From ec0ba0e9d0d502602767ba13ab5d63044a7de92b Mon Sep 17 00:00:00 2001 From: landaiqing Date: Sat, 19 Apr 2025 13:37:27 +0800 Subject: [PATCH] :bug: Fixed errors caused by structure changes --- examples/06_cache_system.go | 6 +++--- pixelnebula_test.go | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/06_cache_system.go b/examples/06_cache_system.go index 888a135..3748595 100644 --- a/examples/06_cache_system.go +++ b/examples/06_cache_system.go @@ -172,9 +172,9 @@ func monitoredCacheExample() { func compressedCacheExample() { // 创建压缩选项 compressOptions := cache.CompressOptions{ - Enabled: true, - Level: 6, - MinSizeBytes: 100, // 最小压缩大小 (字节) + Enabled: true, + Level: 6, + MinSize: 100, // 最小压缩大小 (字节) } // 创建一个带默认缓存和压缩的PixelNebula实例 diff --git a/pixelnebula_test.go b/pixelnebula_test.go index 1aa584b..202da9d 100644 --- a/pixelnebula_test.go +++ b/pixelnebula_test.go @@ -23,9 +23,9 @@ func TestPixelNebula(t *testing.T) { } // 打印可用的风格和主题数量 - fmt.Printf("总风格数量: %d\n", pn.themeManager.StyleCount()) - for i := 0; i < pn.themeManager.StyleCount(); i++ { - fmt.Printf("风格 %d 的主题数量: %d\n", i, pn.themeManager.ThemeCount(i)) + fmt.Printf("总风格数量: %d\n", pn.ThemeManager.StyleCount()) + for i := 0; i < pn.ThemeManager.StyleCount(); i++ { + fmt.Printf("风格 %d 的主题数量: %d\n", i, pn.ThemeManager.ThemeCount(i)) } for i, id := range testIDs { @@ -46,9 +46,9 @@ func TestPixelNebula(t *testing.T) { } // 打印调试信息 - pn.hasher.Reset() - pn.hasher.Write([]byte(id)) - sum := pn.hasher.Sum(nil) + pn.Hasher.Reset() + pn.Hasher.Write([]byte(id)) + sum := pn.Hasher.Sum(nil) hashStr := hex.EncodeToString(sum) // 提取数字 @@ -144,7 +144,7 @@ func TestDemo(t *testing.T) { pn := NewPixelNebula() // 设置风格和尺寸 - pn.WithStyle(style.MetaStyle) + pn.WithStyle(style.GuyStyle) pn.WithTheme(1) pn.WithSize(231, 231)