From f77cd32cf197b684bffc90e5baafd30746ade1b3 Mon Sep 17 00:00:00 2001 From: Zhicheng Zhang Date: Sun, 12 Nov 2017 18:50:03 +0800 Subject: [PATCH] Collections and dictionaries could be edited outside. --- collection.go | 2 ++ dictionary.go | 2 ++ query.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/collection.go b/collection.go index 265b5c9..ff405fc 100644 --- a/collection.go +++ b/collection.go @@ -146,6 +146,8 @@ func (collection *collectionStruct) read(filePath string) (err error) { vocabularyAnswer.Status = "" // add to collection collection.content = append(collection.content, vocabularyAnswer) + // set pointer + collection.content[len(collection.content)-1].Pointer = &(collection.content[len(collection.content)-1]) } } err = nil diff --git a/dictionary.go b/dictionary.go index 57698f6..d81e147 100644 --- a/dictionary.go +++ b/dictionary.go @@ -145,6 +145,8 @@ func (dictionary *dictionaryStruct) read(filePath string) (err error) { vocabularyAnswer.Status = "" // add to dictionary dictionary.content = append(dictionary.content, vocabularyAnswer) + // set pointer + dictionary.content[len(dictionary.content)-1].Pointer = &(dictionary.content[len(dictionary.content)-1]) } } err = nil diff --git a/query.go b/query.go index 8041096..970c9df 100644 --- a/query.go +++ b/query.go @@ -12,7 +12,7 @@ import ( const ( // version - version = "v2.1.0" + version = "v2.2.0" // title in .xlsx file wd = "Word" def = "Define"