File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 6
6
"fmt"
7
7
"os"
8
8
"strconv"
9
+ "strings"
9
10
"text/template"
10
11
"time"
11
12
@@ -20,6 +21,7 @@ func funcMap(consulClient *consul.Client) template.FuncMap {
20
21
"consulKey" : consulKeyFunc (consulClient ),
21
22
"consulKeyExists" : consulKeyExistsFunc (consulClient ),
22
23
"consulKeyOrDefault" : consulKeyOrDefaultFunc (consulClient ),
24
+ "env" : envFunc (),
23
25
"loop" : loop ,
24
26
"parseBool" : parseBool ,
25
27
"parseFloat" : parseFloat ,
@@ -29,7 +31,8 @@ func funcMap(consulClient *consul.Client) template.FuncMap {
29
31
"timeNow" : timeNowFunc ,
30
32
"timeNowUTC" : timeNowUTCFunc ,
31
33
"timeNowTimezone" : timeNowTimezoneFunc (),
32
- "env" : envFunc (),
34
+ "toLower" : toLower ,
35
+ "toUpper" : toUpper ,
33
36
}
34
37
}
35
38
@@ -213,6 +216,14 @@ func timeNowTimezoneFunc() func(string) (string, error) {
213
216
}
214
217
}
215
218
219
+ func toLower (s string ) (string , error ) {
220
+ return strings .ToLower (s ), nil
221
+ }
222
+
223
+ func toUpper (s string ) (string , error ) {
224
+ return strings .ToUpper (s ), nil
225
+ }
226
+
216
227
func envFunc () func (string ) (string , error ) {
217
228
return func (s string ) (string , error ) {
218
229
if s == "" {
You can’t perform that action at this time.
0 commit comments