Skip to content

Instantly share code, notes, and snippets.

@JollyWizard
Last active August 29, 2020 00:50
Show Gist options
  • Save JollyWizard/ec838ba85382ba9a3821e36d83e5a103 to your computer and use it in GitHub Desktop.
Save JollyWizard/ec838ba85382ba9a3821e36d83e5a103 to your computer and use it in GitHub Desktop.
[2020-08-28] An example that will not compile in ytt.
#@ def yml_array_literal1():
- a
- b
#@ end
#@ def yml_array_literal2():
- 1
- 2
#@ end
---
ymlkey1: #@ yml_array_literal1()
ymlkey2: #@ yml_array_literal2()
@JollyWizard
Copy link
Author

JollyWizard commented Aug 29, 2020

The YAML fragments are at different indentation levels, and will not compile.

Returns the error:

Unmarshaling YAML template 'array-literals-error.yml': yaml: line 6: did not find expected <document start>

To fix, a document separator can be used between the 2 function defs, or they can share the same indentation level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment