diff options
author | Andinus <andinus@nand.sh> | 2020-04-06 23:52:41 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-04-06 23:52:41 +0530 |
commit | 30f7ea8ddf1077ddc3bc289f56dff39c41258827 (patch) | |
tree | 51a8660b368d8a5dc67e059973e52d45a2a4aef1 /search/word.go | |
parent | 1e6075d11caa9565e82707fff06e64a7c648464f (diff) | |
download | grus-30f7ea8ddf1077ddc3bc289f56dff39c41258827.tar.gz |
Add Anagrams function
Diffstat (limited to 'search/word.go')
-rw-r--r-- | search/word.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/search/word.go b/search/word.go index a62a393..c83c318 100644 --- a/search/word.go +++ b/search/word.go @@ -1,11 +1,9 @@ package search -import ( - "tildegit.org/andinus/grus/storage" -) +import "tildegit.org/andinus/grus/storage" // Word will search for unjumbled words in database, given sorted word. -func Word(sorted string, db *storage.DB) (out string, err error) { +func Word(sorted string, db *storage.DB) (word string, err error) { db.Mu.RLock() defer db.Mu.RUnlock() @@ -15,7 +13,7 @@ func Word(sorted string, db *storage.DB) (out string, err error) { } defer stmt.Close() - err = stmt.QueryRow(sorted).Scan(&out) + err = stmt.QueryRow(sorted).Scan(&word) if err != nil { return } |