summaryrefslogtreecommitdiffstats
path: root/docs/content/en/functions/collections/NewScratch.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/functions/collections/NewScratch.md')
-rw-r--r--docs/content/en/functions/collections/NewScratch.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/content/en/functions/collections/NewScratch.md b/docs/content/en/functions/collections/NewScratch.md
new file mode 100644
index 000000000..0df90bb96
--- /dev/null
+++ b/docs/content/en/functions/collections/NewScratch.md
@@ -0,0 +1,22 @@
+---
+title: collections.NewScratch
+linkTitle: newScratch
+description: Creates a new Scratch which can be used to store values in a thread safe way.
+categories: [functions]
+keywords: []
+menu:
+ docs:
+ parent: functions
+function:
+ aliases: [newScratch]
+ returnType: Scratch
+ signatures: [collections.NewScratch ]
+relatedFunctions: []
+---
+
+```go-html-template
+{{ $scratch := newScratch }}
+{{ $scratch.Add "b" 2 }}
+{{ $scratch.Add "b" 2 }}
+{{ $scratch.Get "b" }} → 4
+```