27 Jul 2026 01:19 PM
Monaco doesn't seem to support the full gotemplate function when rendering JSON templates. This makes things sometime really hard. Imagine you have a template like this:
"executionSettings": {
"actor": "{{ .actor }}",
"queryOffset": "{{ .queryOffset | default 0}}",
"delay": "{{ .delay | default 60}}"
}
If in config.yml those parameters are defined they are used, if they are not defined then the default value should be used from the template. However monaco complains "function default not defined". Which tells me not a full gotemplate spec is implemented?
03 Aug 2026 01:11 AM
Hi @r_weber
You're right, Monaco uses Go's standard (text/template) engine, not an extended template library like Sprig or Helm's. The stdlib only ships with the built-in functions; default is a Sprig function and isn't part of core Go templates, so Monaco has no way to resolve it unless the maintainers explicitly wired in Sprig's FuncMap — which it doesn't look like they have.
can you use {{ if .queryOffset }}{{ .queryOffset }}{{ else }}0{{ end }} instead of | default 0 — verbose but works with stdlib only.
Thanks,
Sujit
Featured Posts