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

Java Program for Least Common Ancestor Of A Binary Tree

This is common interview question. There can be a variant where we would have to find Least Common Ancestor (LCA) of a Binary Search Tree (B...