"Let say:", {{if}}, , "Hello, StackOverflow!" , , , ( ).
{{- if..., , 1 , , :
Let say:
{{- if eq .Foo "foo" }}
Hello, StackOverflow!
{{- else if eq .Foo "bar" }}
Hello, World!
{{- end }}
, Foo "foo":
Let say:
Hello, StackOverflow!
, Foo "bar":
Let say:
Hello, World!
Go Playground.
, 1.6: text/template: .
- -}}, :
Let say:
{{- if eq .Foo "foo" -}}
Hello, StackOverflow!
{{- else if eq .Foo "bar" -}}
Hello, World!
{{- end -}}
, Foo "foo", Foo - "bar":
Let say:Hello, StackOverflow!
Let say:Hello, World!
.