我导出了一个变量:
export myparam=one
我有模板: file.tmpl :
myproptmpl =
{{ if eq .myparam "one" }}
{{ "one" }}
{{ else }}
{{ "something else" }}
{{ end }}
当我跑步时,confd
我得到:
# /usr/bin/confd -onetime -backend env
2016-04-20T15:21:58Z 8faae31d53a1 /usr/bin/confd[91]: ERROR template: file.tmpl:70:6: executing "file.tmpl" at <eq .myparam "one">: error calling eq: invalid type for comparison
我是新手confd
。如何将 OS 环境变量与值进行比较,并根据它们从模板中生成不同的结果输出文件?