@@ -15,6 +15,7 @@ import (
15
15
func GetSearchTemplates () ([]SearchTemplate , error ) {
16
16
var searchTemplates []SearchTemplate
17
17
var templates []SearchTemplate
18
+ var builtInTemplates []SearchTemplate
18
19
home , err := os .UserHomeDir ()
19
20
if err != nil {
20
21
return nil , err
@@ -49,21 +50,21 @@ func GetSearchTemplates() ([]SearchTemplate, error) {
49
50
50
51
err = json .Unmarshal (raw , & templates )
51
52
if err != nil {
52
- log .Error ("an error occured while parsing the file: %s" , templateFile )
53
+ log .Error ("an error occurred while parsing the file: %s" , templateFile )
53
54
return nil , err
54
55
}
55
56
56
57
searchTemplates = append (searchTemplates , templates ... )
57
58
}
58
59
}
59
60
60
- err = json .Unmarshal ([]byte (builtInSearchTemplates ), & templates )
61
+ err = json .Unmarshal ([]byte (builtInSearchTemplates ), & builtInTemplates )
61
62
if err != nil {
62
- color .Red ("an error occured while parsing the built in templates" )
63
+ color .Red ("an error occurred while parsing the built in templates" )
63
64
return nil , err
64
65
}
65
66
66
- searchTemplates = append (searchTemplates , templates ... )
67
+ searchTemplates = append (searchTemplates , builtInTemplates ... )
67
68
68
69
for i := 0 ; i < len (searchTemplates ); i ++ {
69
70
entry := & searchTemplates [i ]
@@ -115,7 +116,7 @@ func GetExportTemplates() ([]ExportTemplate, error) {
115
116
116
117
err = json .Unmarshal (raw , & templates )
117
118
if err != nil {
118
- log .Debug ("an error occured while parsing the file: %s" , templateFile )
119
+ log .Debug ("an error occurred while parsing the file: %s" , templateFile )
119
120
return nil , err
120
121
}
121
122
@@ -125,7 +126,7 @@ func GetExportTemplates() ([]ExportTemplate, error) {
125
126
126
127
err = json .Unmarshal ([]byte (builtInExportTemplates ), & templates )
127
128
if err != nil {
128
- log .Error ("an error occured while parsing the built in templates" )
129
+ log .Error ("an error occurred while parsing the built in templates" )
129
130
return nil , err
130
131
}
131
132
0 commit comments