From c7dd13034213bf0c048bd32a204365d530716d55 Mon Sep 17 00:00:00 2001 From: huangsimin Date: Tue, 20 Aug 2019 15:37:35 +0800 Subject: [PATCH] =?UTF-8?q?Tried=20=E5=9F=BA=E6=9C=AC=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=8C=E6=88=90.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tree/tried/tried.go | 1 - tree/tried/tried_test.go | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tree/tried/tried.go b/tree/tried/tried.go index 3150406..a4b5e0a 100644 --- a/tree/tried/tried.go +++ b/tree/tried/tried.go @@ -27,7 +27,6 @@ type Node struct { func New() *Tried { tried := &Tried{} tried.root = new(Node) - tried.wiStore = WordIndexDict[WordIndexLower] return tried } diff --git a/tree/tried/tried_test.go b/tree/tried/tried_test.go index 5cbd88a..a92e15f 100644 --- a/tree/tried/tried_test.go +++ b/tree/tried/tried_test.go @@ -317,7 +317,10 @@ func TesStoreData(t *testing.T) { func Load() []string { var result []string - f, _ := os.Open("tried.log") + f, err := os.Open("tried.log") + if err != nil { + panic("先执行TesStoreData 然后再测试Benchmark") + } gob.NewDecoder(f).Decode(&result) return result }