Wednesday, 19 August 2020

What is The Purpose Of Dash Inside Curly Braces In Helm Template

Helm's template internally uses Golang template language. In Go template, dash is used in curly braces to skip white-space around it.

Let's take an example. Suppose {{$test}} evaluates to "ok".

1

{{$test}}

2

will be rendered as

1

ok

2


1

{{- $test}}

2

will be rendered as

1ok

2


1

{{$test -}}

2

will be rendered as

1

ok2


1

{{- $test -}}

2

will be rendered as

1ok2



No comments:

Post a comment

How To Solve XML Parsing Issue "Content is not allowed in prolog" In Java

If you have come to this post, then you are facing xml parsing issue in Java. Caused by: org.xml.sax.SAXParseException; lineNumber: 1; colum...