Rewrite some struct linkages
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package cjlookup
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
query "github.com/tgckpg/golifehk/query"
|
||||
"log"
|
||||
)
|
||||
|
||||
func getSearchables() (*[]query.ISearchable, error) {
|
||||
@@ -21,21 +20,18 @@ func getSearchables() (*[]query.ISearchable, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for jyutping, chars := range jpMap {
|
||||
for _, c := range *chars {
|
||||
cjp := CJyutPing{}
|
||||
cjp.Ref = c
|
||||
cjp.SKey = strings.ToUpper(jyutping)
|
||||
cjp.Key = &cjp.SKey
|
||||
searchables = append(searchables, &cjp)
|
||||
for _, x := range jpMap {
|
||||
if x.Key == nil {
|
||||
log.Fatal("getSearchables CJP: ", x)
|
||||
}
|
||||
searchables = append(searchables, x)
|
||||
}
|
||||
|
||||
for _, c := range chars {
|
||||
ccj := CFace{}
|
||||
ccj.Ref = c
|
||||
ccj.Key = &c.Face
|
||||
searchables = append(searchables, &ccj)
|
||||
for _, x := range chars {
|
||||
if x.Key == nil {
|
||||
log.Fatal("getSearchables CChar: ", x)
|
||||
}
|
||||
searchables = append(searchables, x)
|
||||
}
|
||||
|
||||
return &searchables, nil
|
||||
|
||||
Reference in New Issue
Block a user