Describe the bug
Date strings are interpreted as timestamps. This behavior doesn't seem to be avoidable.
To Reproduce
Make a template that is supposed to substitute a date string. For example ./example/file.txt:
The date is: {{ .THEDATE }}
Run boilerplate:
boilerplate --version
# boilerplate version v0.14.0
boilerplate --template-url ./example --output-folder ./output --var THEDATE="$(date +%Y-%m-%d)"
Then check the output/file.txt. It will have content like:
The date is: 2026-03-26 00:00:00 +0000 UTC
I tried declaring the variable as a string in boilerplate.yml like:
variables:
- name: THEDATE
type: string
That produced an error:
boilerplate --template-url ./example --output-folder ./output --var THEDATE="$(date +%Y-%m-%d)"
# [boilerplate] 2026/03/26 02:11:29 Loading boilerplate config from example/boilerplate.yml
# [boilerplate] 2026/03/26 02:11:29 Loading boilerplate config from example/boilerplate.yml
# ERROR: Value '2026-03-26 00:00:00 +0000 UTC' is not a valid value for variable 'THEDATE' with type 'string'
Expected behavior
I expect the output content to be like:
I think this should be the default behavior (simply assume everything is a string). Additionally if the variable is specifically declared as a string then it should be treated as a string.
Nice to have
Additional context
Describe the bug
Date strings are interpreted as timestamps. This behavior doesn't seem to be avoidable.
To Reproduce
Make a template that is supposed to substitute a date string. For example
./example/file.txt:The date is: {{ .THEDATE }}Run boilerplate:
Then check the
output/file.txt. It will have content like:I tried declaring the variable as a string in boilerplate.yml like:
That produced an error:
Expected behavior
I expect the output content to be like:
I think this should be the default behavior (simply assume everything is a string). Additionally if the variable is specifically declared as a string then it should be treated as a string.
Nice to have
Additional context