Skip to content

Commit ad48cab

Browse files
Update template code to use a shorter approach.
1 parent c253b3d commit ad48cab

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

template_functions.go

+1-11
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@ func getTemplateFunctions(strict bool) template.FuncMap {
2424
},
2525

2626
"envdefault": func(k, defval string) (string, error) {
27-
s, err := envfunc(k, false)
28-
29-
if err != nil {
30-
if _, ok := err.(*enotfounderr); ok {
31-
return defval, nil
32-
}
33-
34-
return "", err
35-
}
36-
37-
if s != "" {
27+
if s, _ := envfunc(k, false); s != "" {
3828
return s, nil
3929
}
4030

0 commit comments

Comments
 (0)