This commit is contained in:
Joe Mooring
2024-03-08 19:31:54 -08:00
committed by GitHub
parent c4611eab52
commit 1f522e32ec
+1 -1
View File
@@ -239,7 +239,7 @@ Use `:=` to initialize a variable, and use `=` to assign a value to a variable t
{{ range slice 7 11 21 }}
{{ $total = add $total . }}
{{ end }}
{{ $v1 }} → 42
{{ $total }} → 42
```
Variables initialized inside of an `if`, `range`, or `with` block are scoped to the block. Variables initialized outside of these blocks are scoped to the template.